macaw-base
Safe HaskellNone
LanguageHaskell2010

Data.Macaw.Dwarf

Description

This defines data structures for parsing Dwarf debug information from binaries.

Synopsis

Compile units and declarations

data Endianness Source #

Indicates whether bytes are stored in big or little endian representation.

In a big endian representation, the most significant byte is stored first; In a little endian representation, the most significant byte is stored last.

Constructors

BigEndian 
LittleEndian 

Instances

Instances details
Show Endianness Source # 
Instance details

Defined in Data.Macaw.Memory

Eq Endianness Source # 
Instance details

Defined in Data.Macaw.Memory

Ord Endianness Source # 
Instance details

Defined in Data.Macaw.Memory

Hashable Endianness Source # 
Instance details

Defined in Data.Macaw.Memory

Lift Endianness Source # 
Instance details

Defined in Data.Macaw.Memory

Methods

lift :: Quote m => Endianness -> m Exp #

liftTyped :: forall (m :: Type -> Type). Quote m => Endianness -> Code m Endianness #

data Sections #

newtype CUOffset #

Constructors

CUOffset Word64 

Instances

Instances details
Read CUOffset 
Instance details

Defined in Data.Dwarf

Show CUOffset 
Instance details

Defined in Data.Dwarf

Eq CUOffset 
Instance details

Defined in Data.Dwarf

Ord CUOffset 
Instance details

Defined in Data.Dwarf

dwarfCompileUnits :: Endianness -> Sections -> ([String], [CompileUnit]) Source #

Deprecated: Use firstCUContext, nextCUContext and getCompileUnit

Return dwarf information out of buffers.

data CompileUnit Source #

The output of one compilation.

Instances

Instances details
Show CompileUnit Source # 
Instance details

Defined in Data.Macaw.Dwarf

Pretty CompileUnit Source # 
Instance details

Defined in Data.Macaw.Dwarf

Methods

pretty :: CompileUnit -> Doc ann

prettyList :: [CompileUnit] -> Doc ann

lookupSubprogram :: SubprogramRef -> CompileUnit -> Maybe Subprogram Source #

Return subprogram in compile unit

dwarfGlobals :: [CompileUnit] -> [Variable] Source #

This returns all the variables in the given compile units.

Utility function

dwarfInfoFromElf :: forall (v :: Nat). Elf v -> ([String], [CompileUnit]) Source #

Return dwarf information out of an Elf file.

Variables

data Variable Source #

Instances

Instances details
Show Variable Source # 
Instance details

Defined in Data.Macaw.Dwarf

Pretty Variable Source # 
Instance details

Defined in Data.Macaw.Dwarf

Methods

pretty :: Variable -> Doc ann

prettyList :: [Variable] -> Doc ann

varOrigin :: Variable -> Maybe VariableRef Source #

A variable reference if this variable comes from an inlined function.

Sub programs

data Subprogram Source #

Constructors

Subprogram 

Fields

Instances

Instances details
Show Subprogram Source # 
Instance details

Defined in Data.Macaw.Dwarf

Pretty Subprogram Source # 
Instance details

Defined in Data.Macaw.Dwarf

Methods

pretty :: Subprogram -> Doc ann

prettyList :: [Subprogram] -> Doc ann

data SubprogramDef Source #

Instances

Instances details
Pretty SubprogramDef Source # 
Instance details

Defined in Data.Macaw.Dwarf

Methods

pretty :: SubprogramDef -> Doc ann

prettyList :: [SubprogramDef] -> Doc ann

Inlineing

data VariableRef Source #

A reference to a variable

Instances

Instances details
Eq VariableRef Source # 
Instance details

Defined in Data.Macaw.Dwarf

Ord VariableRef Source # 
Instance details

Defined in Data.Macaw.Dwarf

Pretty VariableRef Source # 
Instance details

Defined in Data.Macaw.Dwarf

Methods

pretty :: VariableRef -> Doc ann

prettyList :: [VariableRef] -> Doc ann

Locations

data Location Source #

Provides a way of computing the location of a variable.

Instances

Instances details
Eq Location Source # 
Instance details

Defined in Data.Macaw.Dwarf

Ord Location Source # 
Instance details

Defined in Data.Macaw.Dwarf

Pretty Location Source # 
Instance details

Defined in Data.Macaw.Dwarf

Methods

pretty :: Location -> Doc ann

prettyList :: [Location] -> Doc ann

data DeclLoc Source #

A file and line number for a declaration.

Instances

Instances details
Show DeclLoc Source # 
Instance details

Defined in Data.Macaw.Dwarf

Pretty DeclLoc Source # 
Instance details

Defined in Data.Macaw.Dwarf

Methods

pretty :: DeclLoc -> Doc ann

prettyList :: [DeclLoc] -> Doc ann

Type information

data TypeRef Source #

A reference to a type DIE

Instances

Instances details
Show TypeRef Source # 
Instance details

Defined in Data.Macaw.Dwarf

Eq TypeRef Source # 
Instance details

Defined in Data.Macaw.Dwarf

Methods

(==) :: TypeRef -> TypeRef -> Bool #

(/=) :: TypeRef -> TypeRef -> Bool #

Ord TypeRef Source # 
Instance details

Defined in Data.Macaw.Dwarf

Pretty TypeRef Source # 
Instance details

Defined in Data.Macaw.Dwarf

Methods

pretty :: TypeRef -> Doc ann

prettyList :: [TypeRef] -> Doc ann

typeRefFileOffset :: TypeRef -> Word64 Source #

Return the offset asssociated with the type.

data TypeApp Source #

A type form

Constructors

BoolType

A 1-byte boolean value (0 is false, nonzero is true)

UnsignedIntType !Int

An unsigned integer with the given number of bytes (should be positive) The byte order is platform defined.

SignedIntType !Int

An signed integer with the given number of bytes (should be positive) The byte order is platform defined.

FloatType

An IEEE single precision floating point value.

DoubleType

An IEEE double precision floating point value.

LongDoubleType

A long double type.

UnsignedCharType

A 1-byte unsigned character.

SignedCharType

A 1-byte signed character.

ArrayType !TypeRef ![Subrange TypeRef] 
PointerType !(Maybe Word64) !(Maybe TypeRef)

PointerType mw mtp describes a pointer where mtp is the type that the pointer points to (or Nothing) to indicate this is a void pointer. mw is the number of bytes the pointer occupies or Nothing to indicate that is omitted.

StructType !StructDecl

Denotes a C struct

UnionType !UnionDecl

Denotes a C union

EnumType !EnumDecl 
SubroutinePtrType !SubroutineTypeDecl 
TypedefType !Typedef 
TypeQualType !TypeQualAnn

Restrict modifier on type.

SubroutineTypeF !SubroutineTypeDecl

Subroutine type

Instances

Instances details
Show TypeApp Source # 
Instance details

Defined in Data.Macaw.Dwarf

data StructDecl Source #

Instances

Instances details
Show StructDecl Source # 
Instance details

Defined in Data.Macaw.Dwarf

data UnionDecl Source #

Instances

Instances details
Show UnionDecl Source # 
Instance details

Defined in Data.Macaw.Dwarf

data EnumDecl Source #

Constructors

EnumDecl 

Instances

Instances details
Show EnumDecl Source # 
Instance details

Defined in Data.Macaw.Dwarf

data Enumerator Source #

Instances

Instances details
Show Enumerator Source # 
Instance details

Defined in Data.Macaw.Dwarf

data Subrange tp Source #

Constructors

Subrange 

Instances

Instances details
Show tp => Show (Subrange tp) Source # 
Instance details

Defined in Data.Macaw.Dwarf

Methods

showsPrec :: Int -> Subrange tp -> ShowS #

show :: Subrange tp -> String #

showList :: [Subrange tp] -> ShowS #

data Typedef Source #

Instances

Instances details
Show Typedef Source # 
Instance details

Defined in Data.Macaw.Dwarf

data TypeQual Source #

A qualifier on a type.

Instances

Instances details
Show TypeQual Source # 
Instance details

Defined in Data.Macaw.Dwarf

data TypeQualAnn Source #

A type qualifier annotation.

Instances

Instances details
Show TypeQualAnn Source # 
Instance details

Defined in Data.Macaw.Dwarf

Name and Description

newtype Name Source #

Constructors

Name 

Fields

Instances

Instances details
IsString Name Source # 
Instance details

Defined in Data.Macaw.Dwarf

Methods

fromString :: String -> Name #

Show Name Source # 
Instance details

Defined in Data.Macaw.Dwarf

Methods

showsPrec :: Int -> Name -> ShowS #

show :: Name -> String #

showList :: [Name] -> ShowS #

Eq Name Source # 
Instance details

Defined in Data.Macaw.Dwarf

Methods

(==) :: Name -> Name -> Bool #

(/=) :: Name -> Name -> Bool #

Ord Name Source # 
Instance details

Defined in Data.Macaw.Dwarf

Methods

compare :: Name -> Name -> Ordering #

(<) :: Name -> Name -> Bool #

(<=) :: Name -> Name -> Bool #

(>) :: Name -> Name -> Bool #

(>=) :: Name -> Name -> Bool #

max :: Name -> Name -> Name #

min :: Name -> Name -> Name #

Pretty Name Source # 
Instance details

Defined in Data.Macaw.Dwarf

Methods

pretty :: Name -> Doc ann

prettyList :: [Name] -> Doc ann

newtype Description Source #

The value of a DW_AT_description field.

Note. This is the empty string if th

Constructors

Description 

Instances

Instances details
Show Description Source # 
Instance details

Defined in Data.Macaw.Dwarf

Low-level access

data DwarfExpr Source #

Constructors

DwarfExpr !Reader !ByteString 

Instances

Instances details
Show DwarfExpr Source # 
Instance details

Defined in Data.Macaw.Dwarf

Eq DwarfExpr Source # 
Instance details

Defined in Data.Macaw.Dwarf

Ord DwarfExpr Source # 
Instance details

Defined in Data.Macaw.Dwarf

Exports of Data.Dwarf

data DieID #

Instances

Instances details
Read DieID 
Instance details

Defined in Data.Dwarf.Types

Show DieID 
Instance details

Defined in Data.Dwarf.Types

Methods

showsPrec :: Int -> DieID -> ShowS #

show :: DieID -> String #

showList :: [DieID] -> ShowS #

Eq DieID 
Instance details

Defined in Data.Dwarf.Types

Methods

(==) :: DieID -> DieID -> Bool #

(/=) :: DieID -> DieID -> Bool #

Ord DieID 
Instance details

Defined in Data.Dwarf.Types

Methods

compare :: DieID -> DieID -> Ordering #

(<) :: DieID -> DieID -> Bool #

(<=) :: DieID -> DieID -> Bool #

(>) :: DieID -> DieID -> Bool #

(>=) :: DieID -> DieID -> Bool #

max :: DieID -> DieID -> DieID #

min :: DieID -> DieID -> DieID #

data DW_OP #

Instances

Instances details
Read DW_OP 
Instance details

Defined in Data.Dwarf.OP

Show DW_OP 
Instance details

Defined in Data.Dwarf.OP

Methods

showsPrec :: Int -> DW_OP -> ShowS #

show :: DW_OP -> String #

showList :: [DW_OP] -> ShowS #

Eq DW_OP 
Instance details

Defined in Data.Dwarf.OP

Methods

(==) :: DW_OP -> DW_OP -> Bool #

(/=) :: DW_OP -> DW_OP -> Bool #

Ord DW_OP 
Instance details

Defined in Data.Dwarf.OP

Methods

compare :: DW_OP -> DW_OP -> Ordering #

(<) :: DW_OP -> DW_OP -> Bool #

(<=) :: DW_OP -> DW_OP -> Bool #

(>) :: DW_OP -> DW_OP -> Bool #

(>=) :: DW_OP -> DW_OP -> Bool #

max :: DW_OP -> DW_OP -> DW_OP #

min :: DW_OP -> DW_OP -> DW_OP #

data Range #

Constructors

Range 

Fields

Instances

Instances details
Read Range 
Instance details

Defined in Data.Dwarf

Show Range 
Instance details

Defined in Data.Dwarf

Methods

showsPrec :: Int -> Range -> ShowS #

show :: Range -> String #

showList :: [Range] -> ShowS #

Eq Range 
Instance details

Defined in Data.Dwarf

Methods

(==) :: Range -> Range -> Bool #

(/=) :: Range -> Range -> Bool #

Ord Range 
Instance details

Defined in Data.Dwarf

Methods

compare :: Range -> Range -> Ordering #

(<) :: Range -> Range -> Bool #

(<=) :: Range -> Range -> Bool #

(>) :: Range -> Range -> Bool #

(>=) :: Range -> Range -> Bool #

max :: Range -> Range -> Range #

min :: Range -> Range -> Range #