summaryrefslogtreecommitdiffstats
path: root/tools/guest-diag/wall2/t89.py
blob: 92c1de3c1f313dd152a685e9e9a47439b0ee9e3c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import gdb
gr = gdb.execute
inf = gdb.selected_inferior()
pid = inf.pid
base = None
for line in open("/proc/%d/maps" % pid):
    parts = line.split()
    try:
        lo, hi = [int(x,16) for x in parts[0].split('-')]
    except Exception:
        continue
    if base is None and "libnvidia-eglcore" in line and int(parts[2],16) == 0:
        base = lo
print("BASE 0x%x" % (base or 0))
print(gr("x/70i 0x%x" % (base + 0xB28519), to_string=True))
print(gr("x/40i 0x%x" % (base + 0xB28560), to_string=True))
print("T89-DONE")