1 : // Copyright 2012 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 : // Utility code used by various pieces of the Grinder tool.
16 :
17 : #ifndef SYZYGY_GRINDER_GRINDER_UTIL_H_
18 : #define SYZYGY_GRINDER_GRINDER_UTIL_H_
19 :
20 : #include "base/files/file_path.h"
21 : #include "syzygy/core/address.h"
22 :
23 m : namespace grinder {
24 :
25 m : typedef std::vector<core::RelativeAddress> RelativeAddressVector;
26 :
27 : // Gets the addresses of instrumented basic blocks from the PDB file associated
28 : // with a coverage instrumented PE file. This function logs verbosely.
29 : // @param pdb_path the path of the PDB file.
30 : // @param bb_addresses will be populated with the basic block addresses (as
31 : // relative addresses in the original non-instrumented module) upon
32 : // success.
33 : // @returns true on success, false otherwise.
34 m : bool GetBasicBlockAddresses(const base::FilePath& pdb_path,
35 m : RelativeAddressVector* bb_addresses);
36 :
37 m : } // namespace grinder
38 :
39 : #endif // SYZYGY_GRINDER_GRINDER_UTIL_H_
|