| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
| |
This will hopefully prevent:
imports github.com/google/syzkaller/tools/clang/codesearch:
C++ source files not allowed when not using cgo or SWIG: codesearch.cpp
|
| |
|
|
|
|
|
|
|
|
|
| |
Contributes to #6469.
To handle global variables:
* Add EntityKindGlobalVariable
* Modify TraverseVarDecl() function logic
* Add a check to ensure StartLine and EndLine are in the same file
* Fix missing #include <cstdint> in json.h
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Compiled clang tools into Go binaries using cgo.
This significantly simplifies building and deployment.
This also enables unit testing of clang tools.
Now raw go test for clang tools will build them, run,
and verify output.
Each clang tool is still started as a subprocess.
I've experimented with running them in-process,
but this makes stdout/stderr interception extremly complicated,
and it seems that clang tools still use unsynchronized global state,
which breaks when invoked multiple times.
Subprocesses also make it safer in the face of potential memory leaks,
or memory corruptions in clang tools.
Fixes #6645
|
| |
|
|
| |
Also fixes a lint error.
|
| |
|
|
|
|
|
|
|
|
| |
- 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)
|
| |
|
|
|
| |
In LLVM 16+ dyn_cast is no longer null-safe and hence leads to crashes.
This commit switches it to dyn_cast_if_null.
|
| | |
|
| |
|
|
| |
Update #6469
|
| |
|
|
| |
Update #6469
|
| |
|
|
|
|
|
|
|
| |
Extend codesearch clang tool to export info about function references
(calls, takes-address-of).
Add pkg/codesearch command find-references.
Export find-references in pkg/aflow/tools/codesearcher to LLMs.
Update #6469
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When compiling with the changes-meaning flag, syz-codesearch gets a
bunch of errors such as this one:
codesearch.cpp:30:15: error: declaration of ‘clang::SourceRange MacroDef::SourceRange’
changes meaning of ‘SourceRange’ [-Wchanges-meaning]
30 | SourceRange SourceRange; // soruce range of the value
| ^~~~~~~~~~~
codesearch.cpp:30:3: note: used here to mean ‘class clang::SourceRange’
30 | SourceRange SourceRange; // soruce range of the value
| ^~~~~~~~~~~
Let's iron them out early before the code base grows too reliant on
this pattern.
|
|
|
Add a clang tool that is used for code indexing (tools/clang/codesearch/).
It follows conventions and build procedure of the declextract tool.
Add pkg/codesearch package that aggregates the info exposed by the clang tools,
and allows doing simple queries:
- show source code of an entity (function, struct, etc)
- show entity comment
- show all entities defined in a source file
Add tools/syz-codesearch wrapper tool that allows to create index for a kernel build,
and then run code queries on it.
|