1
"""Synthetic symbols tests"""
7
class SynSymTest(unittest.TestCase):
8
"""Unit tests of synthetic symbols"""
11
"""Add new synthetic symbol"""
12
_addr = target.module.offset("FuncTestClass::staticMethod") - 1
14
pykd.addSyntheticSymbol(_addr, 1, "synSym1")
15
self.assertEqual(target.module.synSym1, _addr)
17
self.assertRaises( pykd.DbgException, pykd.addSyntheticSymbol, _addr, 1, "synSym1" )
20
"""Remove synthetic symbol"""
21
_addr = target.module.offset("FuncTestClass::staticMethod") - 2
23
_synsym = pykd.addSyntheticSymbol(_addr, 1, "synSym2")
24
self.assertEqual(target.module.synSym2, _addr)
26
pykd.removeSyntheticSymbol(_synsym)
28
self.assertRaises( pykd.DbgException, target.module.offset, "synSym2" )
30
self.assertRaises( pykd.DbgException, pykd.removeSyntheticSymbol, _synsym )
33
"""Add and remove synthetic module"""
36
pykd.addSyntheticModule(base, 1024, "artificial_module1")
37
pykd.addSyntheticModule(base + 1024, 1024, "artificial_module2", "artificial_module2_path")
39
pykd.removeSyntheticSymbol( pykd.addSyntheticSymbol(base, 1, "artificial_symbol") )
41
pykd.removeSyntheticModule(base + 1024)
42
pykd.removeSyntheticModule(base)