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 PID %d" % (base or 0, pid)) try: pc = int(gdb.parse_and_eval("$pc")) print("PC 0x%x off=0x%x" % (pc, pc - base if base else 0)) except Exception as e: print("pcfail %s" % e) try: C = base + 0x2070B7C print("A8COUNT %u" % int(gdb.parse_and_eval("*(unsigned int*)0x%x" % C))) except Exception as e: print("countfail %s" % e) try: print(gr("bt 6", to_string=True)) except Exception as e: print("btfail %s" % e) gr("detach") gr("quit") print("T102-DONE")