#!/bin/bash cd /tmp (timeout 120 /tmp/vk_frame 1 64 64 5 /tmp 0 > /tmp/vk65.out 2>&1 &) sleep 5 PID=$(pgrep -x vk_frame | head -1) cp /proc/$PID/maps /tmp/maps_d.txt gdb -p $PID -batch -ex "set pagination off" -ex "bt 12" 2>&1 | grep -E "^#" > /tmp/bt_gap3.txt python3 - <<'PY' import re maps=open('/tmp/maps_d.txt').read().splitlines() segs=[] for m in maps: p=m.split() if len(p)<6: continue lo,hi=[int(x,16) for x in p[0].split('-')] off=int(p[2],16) segs.append((lo,hi,off,p[5])) for line in open('/tmp/bt_gap3.txt'): m=re.match(r'#(\d+)\s+0x([0-9a-f]+)', line) if not m: continue a=int(m.group(2),16) for lo,hi,off,name in segs: if lo<=a