BPF_Output eo(fd);
globals glob;
int ret = 0;
+ const token* t = 0;
try
{
translate_globals(glob, s);
if (!init.empty())
{
+ t = begin_v[0]->tok;
program p;
translate_init_and_probe_v(p, glob, init, begin_v);
p.generate();
}
else if (!begin_v.empty())
{
+ t = begin_v[0]->tok;
program p;
translate_probe_v(p, glob, begin_v);
p.generate();
if (!end_v.empty())
{
+ t = end_v[0]->tok;
program p;
translate_probe_v(p, glob, end_v);
p.generate();
for (auto i = kprobe_v.begin(); i != kprobe_v.end(); ++i)
{
+ t = i->first->tok;
program p;
translate_probe(p, glob, i->first);
p.generate();
}
catch (const std::runtime_error &e)
{
- std::cerr << "bpf translation internal error: " << e.what() << std::endl;
+ semantic_error er(ERR_SRC, _F("bpf translation failure: %s", e.what()), t);
+ s.print_error(er);
ret = 1;
}
catch (...)