diff options
author | Chris Johns <chrisj@rtems.org> | 2018-05-08 15:09:38 +1000 |
---|---|---|
committer | Chris Johns <chrisj@rtems.org> | 2018-06-15 15:54:25 +1000 |
commit | 558cab8e4f0d1793e7be21cc118aed5b293c022a (patch) | |
tree | b6947c683e48f41d12f6d7480081a52c624c0fa7 /rtemstoolkit/rld-elf.cpp | |
parent | 1a89c3d78900e8c4d60afcf9978aa2f283121320 (diff) |
rtemstoolkit: Add libdwarf C++ interface.
Provide a C++ interface to libdwarf to:
- Manage DWARF debug data
- Manage CU
- Manage DIE
- Handle CU line addresses
- Handle CU source files
Update #3417
Diffstat (limited to 'rtemstoolkit/rld-elf.cpp')
-rw-r--r-- | rtemstoolkit/rld-elf.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/rtemstoolkit/rld-elf.cpp b/rtemstoolkit/rld-elf.cpp index 8b2ac5e..2d3d090 100644 --- a/rtemstoolkit/rld-elf.cpp +++ b/rtemstoolkit/rld-elf.cpp @@ -421,6 +421,7 @@ namespace rld file::file () : fd_ (-1), + refs (0), archive (false), writable (false), elf_ (0), @@ -438,6 +439,18 @@ namespace rld } void + file::reference_obtain () + { + ++refs; + } + + void + file::reference_release () + { + --refs; + } + + void file::begin (const std::string& name__, int fd__, const bool writable_) { begin (name__, fd__, writable_, 0, 0); @@ -551,6 +564,9 @@ namespace rld void file::end () { + if (refs > 0) + throw rld::error ("References still held", "elf:file:end: " + name_); + if (elf_) { if (rld::verbose () >= RLD_VERBOSE_FULL_DEBUG) |