package owee

  1. Overview
  2. Docs
type header
val read_chunk : Owee_buf.cursor -> (header * Owee_buf.cursor) option

read_chunk cursor expects cursor to be pointing to the beginning of a DWARF linenumber program. Those are usually put in ".debug_line" section of an ELF binary. Iff such a program is found, the cursor is advanced to the next one (or to the end) and Some (header, cursor') is returned.

type state = {
  1. mutable address : int;
  2. mutable filename : string;
  3. mutable file : int;
  4. mutable line : int;
  5. mutable col : int;
  6. mutable is_statement : bool;
  7. mutable basic_block : bool;
  8. mutable end_sequence : bool;
  9. mutable prologue_end : bool;
  10. mutable epilogue_begin : bool;
  11. mutable isa : int;
  12. mutable discriminator : int;
}

State of the linenumber automaton. IMPORTANT: this state is mutable! A value of this type can change as the file is scanned.

val get_filename : header -> state -> string option

get_filename header state get the filename associated to the row described by state. Linenumber programs are allowed to store the filename as an index to a registry in the state.file field. This function reads this registry if state.file is valid, or returns state.filename.

val fold_rows : (header * Owee_buf.cursor) -> (header -> state -> 'a -> 'a) -> 'a -> 'a

fold_rows (header, cursor) f init will fold over the rows defined by the program described by (header, cursor), using the function f and initial state init.

val copy : state -> state

copy state returns a copy of the mutable state

OCaml

Innovation. Community. Security.