mirror of
https://gitea.osmocom.org/cellular-infrastructure/osmo-msc.git
synced 2025-10-23 08:12:10 +00:00
This is the first step in creating this repository from the legacy openbsc.git. Like all other Osmocom repositories, keep the autoconf and automake files in the repository root. openbsc.git has been the sole exception, which ends now. Change-Id: I9c6f2a448d9cb1cc088cf1cf6918b69d7e69b4e7
34 lines
636 B
Python
Executable File
34 lines
636 B
Python
Executable File
#!/usr/bin/env python
|
|
|
|
import os
|
|
|
|
f = open("unbalanced")
|
|
lines = []
|
|
for line in f:
|
|
lines.append(line)
|
|
|
|
filenames = {}
|
|
|
|
output = []
|
|
for line in lines:
|
|
if "[0x" in line:
|
|
start = line.find("[")
|
|
end = line.find("]")
|
|
addr = line[start+1:end]
|
|
try:
|
|
file = filenames[addr]
|
|
except KeyError:
|
|
r = os.popen("addr2line -fs -e ./bsc_hack %s" % addr)
|
|
all = r.read().replace("\n", ",")
|
|
file = all
|
|
filenames[addr] = file
|
|
|
|
line = line.replace(addr, file)
|
|
output.append(line)
|
|
|
|
g = open("unbalanced.2", "w")
|
|
g.write("".join(output))
|
|
|
|
|
|
|