#include "nvbit-sys/nvbit/nvbit_bridge.h" #include "nvbit-sys/src/nvbit.rs.h" std::unique_ptr> rust_nvbit_get_related_functions( CUcontext ctx, CUfunction func) { // printf("get related functions for func=%p ctx=%p\n", func, ctx); std::vector related = nvbit_get_related_functions(ctx, func); auto vec = std::unique_ptr>( new std::vector()); for (auto& element : related) { vec->push_back(CUfunctionShim{element}); } return vec; } std::unique_ptr> rust_nvbit_get_instrs(CUcontext ctx, CUfunction func) { std::vector instructions = nvbit_get_instrs(ctx, func); auto vec = std::unique_ptr>(new std::vector()); for (auto& instr : instructions) { vec->push_back(InstrShim{instr}); } return vec; }