From 0ce7d86d6a53b38ed75045173da33b277415254d Mon Sep 17 00:00:00 2001 From: Tamas Koczka Date: Wed, 28 Jan 2026 14:34:43 +0000 Subject: pkg/codesearch: expose struct layout in codesearch - Extract struct field offsets and sizes in the C++ codesearch indexer. - Add 'fields' to the JSON definition output. - Update pkg/codesearch to parse and expose the new field information. - Add 'struct-layout' command to syz-codesearch for debugging. - Add 'codesearch-struct-layout' tool to pkg/aflow/tool/codesearcher/ to allow LLM agents to query struct memory layout and map byte offsets to fields. - Support pointer marshaling for optional JSON values (e.g. *uint) --- pkg/codesearch/testdata/query-struct-layout-some-struct | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 pkg/codesearch/testdata/query-struct-layout-some-struct (limited to 'pkg/codesearch/testdata/query-struct-layout-some-struct') diff --git a/pkg/codesearch/testdata/query-struct-layout-some-struct b/pkg/codesearch/testdata/query-struct-layout-some-struct new file mode 100644 index 000000000..a7d8e418e --- /dev/null +++ b/pkg/codesearch/testdata/query-struct-layout-some-struct @@ -0,0 +1,5 @@ +struct-layout testdata/source0.h some_struct + +struct some_struct has 2 fields: +[0 - 32] x +[32 - 64] y -- cgit mrf-deployment