mirror of
https://git.sfja.dk/Mikkel/slige.git
synced 2025-01-18 12:46:31 +00:00
37 lines
918 B
C++
37 lines
918 B
C++
#include "actions.hpp"
|
|
#include "vm_provider.hpp"
|
|
|
|
auto sliger::rpc::action::RunDebug::perform_action(
|
|
std::unique_ptr<sliger::rpc::BufferedWriter> writer,
|
|
vm_provider::VmProvider vm) -> void
|
|
{
|
|
auto program = this->instructions;
|
|
vm.load_and_run(program);
|
|
};
|
|
|
|
auto sliger::rpc::action::FlameGraph::perform_action(
|
|
std::unique_ptr<sliger::rpc::BufferedWriter> writer,
|
|
vm_provider::VmProvider vm) -> void
|
|
{
|
|
auto json = vm.flame_graph_json();
|
|
if (json) {
|
|
writer->write(json.value());
|
|
} else {
|
|
writer->write("null");
|
|
}
|
|
writer->flush();
|
|
};
|
|
|
|
auto sliger::rpc::action::CodeCoverage::perform_action(
|
|
std::unique_ptr<sliger::rpc::BufferedWriter> writer,
|
|
vm_provider::VmProvider vm) -> void
|
|
{
|
|
auto json = vm.code_coverage_json();
|
|
if (json) {
|
|
writer->write(json.value());
|
|
} else {
|
|
writer->write("null");
|
|
}
|
|
writer->flush();
|
|
};
|