本文整理汇总了Python中collector.Collector.symbol_by_addr方法的典型用法代码示例。如果您正苦于以下问题:Python Collector.symbol_by_addr方法的具体用法?Python Collector.symbol_by_addr怎么用?Python Collector.symbol_by_addr使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类collector.Collector
的用法示例。
在下文中一共展示了Collector.symbol_by_addr方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_derive_filename_from_assembly
# 需要导入模块: from collector import Collector [as 别名]
# 或者: from collector.Collector import symbol_by_addr [as 别名]
def test_derive_filename_from_assembly(self):
c = Collector()
c.parse_assembly_text("""
000008a8 <uses_doubles2.constprop.0>:
uses_doubles2():
/Users/behrens/Documents/projects/pebble/puncover/pebble/build/../src/puncover.c:19
8a8: b508 push {r3, lr}
""")
s = c.symbol_by_addr("8a8")
self.assertEqual("/Users/behrens/Documents/projects/pebble/puncover/pebble/build/../src/puncover.c", s[collector.PATH])
self.assertEqual("puncover.c", s[collector.BASE_FILE])
self.assertEqual(19, s[collector.LINE])
示例2: test_enhance_function_size_from_assembly
# 需要导入模块: from collector import Collector [as 别名]
# 或者: from collector.Collector import symbol_by_addr [as 别名]
def test_enhance_function_size_from_assembly(self):
c = Collector()
c.symbols = { int("0000009c", 16) : {
collector.ADDRESS: "0000009c",
collector.ASM: """
$t():
9c: f081 4100 eor.w r1, r1, #2147483648 ; 0x80000000
a0: e002 b.n a8 <__adddf3>
a2: bf00 nop
""".split("\n")
}}
s = c.symbol_by_addr("9c")
self.assertFalse(s.has_key(collector.SIZE))
c.enhance_function_size_from_assembly()
self.assertEqual(8, s[collector.SIZE])