#!/usr/bin/env python3 """Build, launch, inspect, and smoke-test the x86 native-code development VM.""" import argparse import hashlib import json import os import re from pathlib import Path import shutil import socket import struct import subprocess import time from evidence import write_evidence ROOT = Path(__file__).resolve().parents[1] STATE = ROOT / ".stela" / "vm" # Keep UNIX socket paths below macOS's 104-byte limit even in deep checkouts. QMP_PORT = 4444 GDB_PORT = 1234 def fixture_symbols(path): """Read symbols from our locally generated ELF32 fixture (no extra tools).""" data = path.read_bytes() if data[:6] != b"\x7fELF\x01\x01": raise RuntimeError("Expected a little-endian ELF32 fixture") table = struct.unpack_from("