fix(tools): self-locate DB / cwd instead of the stale renamed path
zq.py and sylph-run.sh hard-coded '/home/fabi/RE - Project Sylpheed/...' (the dashed dir was renamed 'RE Project Sylpheed'), so both were broken. Resolve relative to the script directory now; zq.py honours $SYLPHEED_DB. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -19,7 +19,9 @@
|
|||||||
# resumes (tid25 start_entry 0x82506588 / tid26 0x825065b8). Full per-run log kept under
|
# resumes (tid25 start_entry 0x82506588 / tid26 0x825065b8). Full per-run log kept under
|
||||||
# /tmp/sylph-run/.
|
# /tmp/sylph-run/.
|
||||||
set -u
|
set -u
|
||||||
cd "/home/fabi/RE - Project Sylpheed/xenia-rs" || exit 2
|
# cd to this script's own dir (was a hard-coded '/home/fabi/RE - Project Sylpheed/
|
||||||
|
# xenia-rs' that went stale when the tree was renamed 'RE Project Sylpheed').
|
||||||
|
cd "$(dirname "$(readlink -f "$0")")" || exit 2
|
||||||
RUNS="${1:-6}"; N="${2:-3000000000}"; TO="${3:-180}"; XGREP="${4:-}"
|
RUNS="${1:-6}"; N="${2:-3000000000}"; TO="${3:-180}"; XGREP="${4:-}"
|
||||||
OUT=/tmp/sylph-run; mkdir -p "$OUT"
|
OUT=/tmp/sylph-run; mkdir -p "$OUT"
|
||||||
BIN=./target/release/xenia-rs
|
BIN=./target/release/xenia-rs
|
||||||
|
|||||||
8
zq.py
8
zq.py
@@ -14,9 +14,13 @@ Usage:
|
|||||||
zq.py grep <substr> # instructions whose operands LIKE %substr%
|
zq.py grep <substr> # instructions whose operands LIKE %substr%
|
||||||
zq.py find <word_hex> # instructions whose raw word == value (e.g. a ptr)
|
zq.py find <word_hex> # instructions whose raw word == value (e.g. a ptr)
|
||||||
"""
|
"""
|
||||||
import duckdb, sys
|
import duckdb, sys, os
|
||||||
|
|
||||||
DB = '/home/fabi/RE - Project Sylpheed/xenia-rs/sylpheed.db'
|
# Resolve the DB next to this script so the tool survives the tree being renamed
|
||||||
|
# (the old hard-coded '/home/fabi/RE - Project Sylpheed/...' path went stale when
|
||||||
|
# the dir became 'RE Project Sylpheed'). Override with $SYLPHEED_DB.
|
||||||
|
DB = os.environ.get('SYLPHEED_DB',
|
||||||
|
os.path.join(os.path.dirname(os.path.abspath(__file__)), 'sylpheed.db'))
|
||||||
c = duckdb.connect(DB, read_only=True)
|
c = duckdb.connect(DB, read_only=True)
|
||||||
H = lambda x: '0x%08x' % x
|
H = lambda x: '0x%08x' % x
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user