Coverage for /Syzygy/assm/unittest_util.cc

CoverageLines executed / instrumented / missingexe / inst / missLanguageGroup
0.0%0058.C++test

Line-by-line coverage:

   1    :  // Copyright 2015 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/assm/unittest_util.h"
  16    :  
  17  m :  namespace testing {
  18    :  
  19    :  // Definitions of various length NOP codes for 32-bit X86. We use the same
  20    :  // ones that are typically used by MSVC and recommended by Intel in
  21    :  // the Intel Architecture Software Developer's manual, page 4-8.
  22    :  
  23    :  // NOP (XCHG EAX, EAX)
  24  m :  const uint8_t kNop1[1] = {0x90};
  25    :  // 66 NOP
  26  m :  const uint8_t kNop2[2] = {0x66, 0x90};
  27    :  // LEA REG, 0 (REG) (8-bit displacement)
  28  m :  const uint8_t kNop3[3] = {0x66, 0x66, 0x90};
  29    :  // NOP DWORD PTR [EAX + 0] (8-bit displacement)
  30  m :  const uint8_t kNop4[4] = {0x0F, 0x1F, 0x40, 0x00};
  31    :  // NOP DWORD PTR [EAX + EAX*1 + 0] (8-bit displacement)
  32  m :  const uint8_t kNop5[5] = {0x0F, 0x1F, 0x44, 0x00, 0x00};
  33    :  // LEA REG, 0 (REG) (32-bit displacement)
  34  m :  const uint8_t kNop6[6] = {0x66, 0x0F, 0x1F, 0x44, 0x00, 0x00};
  35    :  // LEA REG, 0 (REG) (32-bit displacement)
  36  m :  const uint8_t kNop7[7] = {0x0F, 0x1F, 0x80, 0x00, 0x00, 0x00, 0x00};
  37    :  // NOP DWORD PTR [EAX + EAX*1 + 0] (32-bit displacement)
  38  m :  const uint8_t kNop8[8] = {0x0F, 0x1F, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00};
  39    :  // NOP WORD  PTR [EAX + EAX*1 + 0] (32-bit displacement)
  40  m :  const uint8_t kNop9[9] = {
  41  m :      0x66,  // Prefix,
  42  m :      0x0F,
  43  m :      0x1F,
  44  m :      0x84,
  45  m :      0x00,
  46  m :      0x00,
  47  m :      0x00,
  48  m :      0x00,
  49  m :      0x00  // kNop8.
  50  m :  };
  51  m :  const uint8_t kNop10[10] = {
  52  m :      0x66,
  53  m :      0x66,  // Prefix,
  54  m :      0x0F,
  55  m :      0x1F,
  56  m :      0x84,
  57  m :      0x00,
  58  m :      0x00,
  59  m :      0x00,
  60  m :      0x00,
  61  m :      0x00  // kNop8.
  62  m :  };
  63  m :  const uint8_t kNop11[11] = {
  64  m :      0x66,
  65  m :      0x66,
  66  m :      0x66,  // Prefix,
  67  m :      0x0F,
  68  m :      0x1F,
  69  m :      0x84,
  70  m :      0x00,
  71  m :      0x00,
  72  m :      0x00,
  73  m :      0x00,
  74  m :      0x00  // kNop8.
  75  m :  };
  76    :  
  77    :  // Collect all of the various NOPs in an array indexable by their length.
  78  m :  const uint8_t* kNops[12] = {nullptr,
  79  m :                              kNop1,
  80  m :                              kNop2,
  81  m :                              kNop3,
  82  m :                              kNop4,
  83  m :                              kNop5,
  84  m :                              kNop6,
  85  m :                              kNop7,
  86  m :                              kNop8,
  87  m :                              kNop9,
  88  m :                              kNop10,
  89  m :                              kNop11};
  90    :  
  91  m :  }  // namespace testing

Coverage information generated Fri Jul 29 11:00:21 2016.