LocalSymbol, BpfGlobalSymbol and MapSymbol each named the storage behind a
name differently (var, var, sym) and shared no type. They now all derive from
symbols.Symbol, which carries what every symbol has -- the storage pointer
(alloca, GlobalVariable, or None for the context parameter) and its IR type
-- and each subclass adds only what its kind needs: LocalSymbol its metadata
and declared_global flag, BpfGlobalSymbol its ctypes name, MapSymbol its map
type and params. MapSymbol.sym becomes var to match.
local_symbol.py is folded into the new symbols.py. LocalSymbol keeps its
three-field __iter__ for the call sites that tuple-unpack a symbol.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BSDVsZH5NtoASyxB8FCtGU
process_bpf_map logged a warning and fell back to process_hash_map for any map
type it did not recognise. That turns a typo into an object file that compiles
cleanly, carries the wrong BPF_MAP_TYPE, skips the intended map type's
parameter validation entirely, and is only rejected once it reaches the kernel
-- as tests/passing_tests/ringbuf.py was, with 'failed to create: -EINVAL'.
A warning was not enough to surface it either: the test framework only fails a
test on logging.ERROR records.
Raise instead, naming the registered map types so the fix is obvious:
ValueError: Unknown map type 'RingBuf' returned by 'm'.
Known map types: HashMap, PerfEventArray, RingBuffer
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>