Coverage for /Syzygy/instrument/instrumenters/coverage_instrumenter.cc

CoverageLines executed / instrumented / missingexe / inst / missLanguageGroup
85.7%12140.C++source

Line-by-line coverage:

   1    :  // Copyright 2013 Google Inc. All Rights Reserved.
   2    :  //
   3    :  // Licensed under the Apache License, Version 2.0 (the "License");
   4    :  // you may not use this file except in compliance with the License.
   5    :  // You may obtain a copy of the License at
   6    :  //
   7    :  //     http://www.apache.org/licenses/LICENSE-2.0
   8    :  //
   9    :  // Unless required by applicable law or agreed to in writing, software
  10    :  // distributed under the License is distributed on an "AS IS" BASIS,
  11    :  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12    :  // See the License for the specific language governing permissions and
  13    :  // limitations under the License.
  14    :  
  15    :  #include "syzygy/instrument/instrumenters/coverage_instrumenter.h"
  16    :  
  17    :  #include "base/file_util.h"
  18    :  #include "base/logging.h"
  19    :  #include "syzygy/application/application.h"
  20    :  #include "syzygy/pe/image_filter.h"
  21    :  
  22    :  namespace instrument {
  23    :  namespace instrumenters {
  24    :  
  25    :  const char CoverageInstrumenter::kAgentDllCoverage[] = "coverage_client.dll";
  26    :  
  27  E :  CoverageInstrumenter::CoverageInstrumenter() {
  28  E :    agent_dll_ = kAgentDllCoverage;
  29  E :  }
  30    :  
  31  E :  bool CoverageInstrumenter::InstrumentImpl() {
  32    :    coverage_transform_.reset(
  33  E :        new instrument::transforms::CoverageInstrumentationTransform());
  34  E :    coverage_transform_->set_instrument_dll_name(agent_dll_);
  35  E :    coverage_transform_->set_src_ranges_for_thunks(debug_friendly_);
  36  E :    if (!relinker_->AppendTransform(coverage_transform_.get()))
  37  i :      return false;
  38    :  
  39    :    add_bb_addr_stream_mutator_.reset(
  40    :          new instrument::mutators::AddIndexedDataRangesStreamPdbMutator(
  41    :              coverage_transform_->bb_ranges(),
  42  E :              common::kBasicBlockRangesStreamName));
  43  E :    if (!relinker_->AppendPdbMutator(add_bb_addr_stream_mutator_.get()))
  44  i :      return false;
  45    :  
  46  E :    return true;
  47  E :  }
  48    :  
  49    :  }  // namespace instrumenters
  50    :  }  // namespace instrument

Coverage information generated Thu Mar 26 16:15:41 2015.