scripts/gdb: add internal helper and convenience function for per-cpu lookup