Added dwarf/compileunit.py and dwarf/dwarfinfo.py and started filling in details
diff --git a/elftools/common/utils.py b/elftools/common/utils.py
index 8b9b9ae..c099013 100644
--- a/elftools/common/utils.py
+++ b/elftools/common/utils.py
@@ -28,6 +28,15 @@
def elf_assert(cond, msg=''):
""" Assert that cond is True, otherwise raise ELFError(msg)
"""
- if not cond:
- raise ELFError(msg)
+ _assert_with_exception(cond, msg, ELFError)
+
+def dwarf_assert(cond, msg=''):
+ """ Assert that cond is True, otherwise raise DWARFError(msg)
+ """
+ _assert_with_exception(cond, msg, DWARFError)
+
+
+def _assert_with_exception(cond, msg, exception_type):
+ if not cond:
+ raise exception_type(msg)
\ No newline at end of file