MCPcopy Create free account
hub / github.com/dmtcp/dmtcp / writeSymbolFileToScript

Function writeSymbolFileToScript

util/save-symbol-files-to-gdb-script.py:53–64  ·  view source on GitHub ↗
(filename_substring)

Source from the content-addressed store, hash-verified

51
52
53def writeSymbolFileToScript(filename_substring):
54 (filename, base_addr) = memory_region(filename_substring)
55 if is_executable(filename):
56 base_addr = 0 # ELF executables already hard-wired absolute address
57 (textaddr, sections) = relocatesections(filename)
58 cmd = "add-symbol-file %s 0x%x" % (filename, int(textaddr, 16) + base_addr)
59 for s in sections:
60 addr = int(s['addr'], 16)
61 if s['name'] == '.text' or addr == 0:
62 continue
63 cmd += " -s %s 0x%x" % (s['name'], addr + base_addr)
64 print(cmd + "\n")
65
66
67def saveSymbolFilesToGdbScript():

Callers 1

Calls 3

is_executableFunction · 0.85
memory_regionFunction · 0.70
relocatesectionsFunction · 0.70

Tested by

no test coverage detected