Expose dwarf constants for debug info generation

This commit is contained in:
Mark Florisson 2013-01-21 10:52:29 -06:00
commit 93f8c70d19
4 changed files with 223 additions and 1 deletions

30
test/test_debuginfo.py Normal file
View file

@ -0,0 +1,30 @@
import os
import unittest
from llvm.core import *
from llvm import _dwarf
class TestDebugInfo(unittest.TestCase):
def test_dwarf_constants(self):
dwarf_constants = vars(_dwarf)
# Version numbers
self.assertIn("LLVMDebugVersion", dwarf_constants)
self.assertIn("DWARF_VERSION", dwarf_constants)
# Tags
self.assertIn("DW_TAG_compile_unit", dwarf_constants)
# Language identifiers
self.assertIn("DW_LANG_Python", dwarf_constants)
self.assertIn("DW_LANG_C89", dwarf_constants)
self.assertIn("DW_LANG_C99", dwarf_constants)
# print sorted([constname for constname in dwarf_constants
# if constname.startswith("DW_LANG_")])
if __name__ == '__main__':
# TestDebugInfo("test_dwarf_constants").debug()
unittest.main()