| 1 | import unittest |
| 2 | import os.path |
| 3 | import bt2 |
| 4 | import os |
| 5 | |
| 6 | |
| 7 | @unittest.skip('depends on Python bindings, which are broken') |
| 8 | class LttngUtilsDebugInfoTestCase(unittest.TestCase): |
| 9 | def test_debug_info(self): |
| 10 | debug_info_data_dir = os.environ['DEBUG_INFO_DATA_DIR'] |
| 11 | trace_path = os.path.join(debug_info_data_dir, 'trace') |
| 12 | target_prefix = os.path.join(debug_info_data_dir, '..', '..') |
| 13 | src = bt2.ComponentSpec('ctf', 'fs', trace_path) |
| 14 | flt = bt2.ComponentSpec('lttng-utils', 'debug-info', { |
| 15 | 'target-prefix': target_prefix, |
| 16 | }) |
| 17 | it = bt2.TraceCollectionNotificationIterator(src, flt, |
| 18 | [bt2.EventNotification]) |
| 19 | notifs = list(it) |
| 20 | debug_info = notifs[2].event['debug_info'] |
| 21 | self.assertEqual(debug_info['bin'], 'libhello_so+0x14d4') |
| 22 | self.assertEqual(debug_info['func'], 'foo+0xa9') |
| 23 | self.assertEqual(debug_info['src'], 'libhello.c:7') |
| 24 | debug_info = notifs[3].event['debug_info'] |
| 25 | self.assertEqual(debug_info['bin'], 'libhello_so+0x15a6') |
| 26 | self.assertEqual(debug_info['func'], 'bar+0xa9') |
| 27 | self.assertEqual(debug_info['src'], 'libhello.c:13') |