]>
sourceware.org Git - systemtap.git/blob - dwarf_wrappers.h
2 // Copyright (C) 2008 Red Hat Inc.
4 // This file is part of systemtap, and is free software. You can
5 // redistribute it and/or modify it under the terms of the GNU General
6 // Public License (GPL); either version 2, or (at your option) any
9 #ifndef DWARF_WRAPPERS_H
10 #define DWARF_WRAPPERS_H 1
11 #include <elfutils/libdw.h>
15 // NB: "rc == 0" means OK in this case
16 void dwfl_assert(const std::string
& desc
, int rc
);
18 // Throw error if pointer is NULL.
20 void dwfl_assert(const std::string
& desc
, T
* ptr
)
23 dwfl_assert(desc
, -1);
26 // Throw error if pointer is NULL
28 void dwfl_assert(const std::string
& desc
, const T
* ptr
)
31 dwfl_assert(desc
, -1);
34 // Throw error if condition is false
35 void dwfl_assert(const std::string
& desc
, bool condition
);
37 // NB: "rc == 0" means OK in this case
38 void dwarf_assert(const std::string
& desc
, int rc
);
40 // Throw error if pointer is NULL
42 void dwarf_assert(const std::string
& desc
, T
* ptr
)
45 dwarf_assert(desc
, -1);
52 const Dwarf_Line
* line
;
53 dwarf_line_t() : line(0) {}
54 dwarf_line_t(const Dwarf_Line
* line_
) : line(line_
) {}
56 dwarf_line_t
& operator= (const Dwarf_Line
* line_
)
71 dwarf_assert("dwarf_line_t::lineno", -1);
72 dwarf_lineno(const_cast<Dwarf_Line
*>(line
), &lineval
);
75 Dwarf_Addr
addr() const
79 dwarf_assert("dwarf_line_t::addr", -1);
80 dwarf_lineaddr(const_cast<Dwarf_Line
*>(line
), &addrval
);
83 const char* linesrc(Dwarf_Word
* mtime
= 0, Dwarf_Word
* length
= 0)
85 const char* retval
= dwarf_linesrc(const_cast<Dwarf_Line
*>(line
), mtime
,
87 dwarf_assert("dwarf_line_t::linesrc", retval
);
This page took 0.037425 seconds and 5 git commands to generate.