(filename_substring)
| 51 | |
| 52 | |
| 53 | def 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 | |
| 67 | def saveSymbolFilesToGdbScript(): |
no test coverage detected