hyperplatform_log_parser/log_line_parser.cpp
// Attempts to parse a line reported for dodgy region execution
Attempts to parse a line reported for dodgy region execution
Attempts to parse a line reported for dodgy region execution
bool LogLineParser::TryParseExecutionLog() {
  std::regex regex(
    "\\[EXEC\\] \\*\\*\\* "
    "VA = ([[:xdigit:]]{" + pointer_size_ + "}), "
    "PA = [[:xdigit:]]{16}, "
    "Return = ([[:xdigit:]]{" + pointer_size_ + "}), "
    "ReturnBase = ([[:xdigit:]]{" + pointer_size_ + "})");
  std::smatch match;
  if (!std::regex_match(message_, match, regex)) {
    return false;
  }
  const auto executed_address = std::stoull(match[1].str(), nullptr, 16);
  const auto return_address = std::stoull(match[2].str(), nullptr, 16);
  const auto return_base_address = std::stoull(match[3].str(), nullptr, 16);
  const auto symbol =
      driver_symbol_resolver_.GetName(return_address, return_base_address);
  const std::string format_string = "%s %5u:%5u executed %" + pointer_size_ +
                                    "llx, will return to %" + pointer_size_ +
                                    "llx %S\n";
  printf(format_string.c_str(), time_.c_str(), pid_, tid_, executed_address,
         return_address, symbol.c_str());
  return true;
}
bool LogLineParser :: TryParseExecutionLog ( ) { std :: regex regex ( " \\ \\ \\ \\ \\ " " " + pointer_size_ + " " " " " " + pointer_size_ + " " " " + pointer_size_ + " " ) ; std :: smatch match ; if ( ! std :: regex_match ( message_ , match , regex ) ) { return false ; } const auto executed_address = std :: stoull ( match [ 1 ] . str ( ) , nullptr , 16 ) ; const auto return_address = std :: stoull ( match [ 2 ] . str ( ) , nullptr , 16 ) ; const auto return_base_address = std :: stoull ( match [ 3 ] . str ( ) , nullptr , 16 ) ; const auto symbol = driver_symbol_resolver_ . GetName ( return_address , return_base_address ) ; const std :: string format_string = " " + pointer_size_ + " " + pointer_size_ + " \n " ; printf ( format_string . c_str ( ) , time_ . c_str ( ) , pid_ , tid_ , executed_address , return_address , symbol . c_str ( ) ) ; return true ; }
Attempts to parse a line reported for dodgy region execution
Attempts to parse a line reported for dodgy region execution
// clang-format off // clang-format on // Successfully parsed. Print it to STDIO