PDG Query – Program Dependence Graph Queries

Interactive and batch query engine for the Program Dependence Graph (PDG).

Binary: pdg-query Location: tools/ir/pdg-query.cpp

Usage:

# Interactive mode
./build/bin/pdg-query -i program.bc

# Single query
./build/bin/pdg-query -q "MATCH (n:FUNC_ENTRY) WHERE n.name = 'main' RETURN n" program.bc

# Batch queries from file
./build/bin/pdg-query -f queries.txt program.bc

Key features:

  • Forward/backward slicing

  • Property-based slicing via --property-file

  • Information flow queries

  • Security policy checks

  • Subgraph export (DOT)

See PDG Query Language (Cypher) for the language reference and PDG Query Example Cookbook for the in-repo query cookbook.