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 : // Defines the RelinkApp class, which implements the command-line relink tool.
16 :
17 : #ifndef SYZYGY_RELINK_RELINK_APP_H_
18 : #define SYZYGY_RELINK_RELINK_APP_H_
19 :
20 : #include "base/command_line.h"
21 : #include "base/string_piece.h"
22 : #include "base/time.h"
23 : #include "base/files/file_path.h"
24 : #include "syzygy/common/application.h"
25 :
26 : namespace relink {
27 :
28 : // This class implements the command-line relink utility.
29 : class RelinkApp : public common::AppImplBase {
30 : public:
31 : RelinkApp()
32 : : AppImplBase("Relinker"),
33 : seed_(0),
34 : padding_(0),
35 : no_augment_pdb_(false),
36 : compress_pdb_(false),
37 : no_strip_strings_(false),
38 : output_metadata_(false),
39 : overwrite_(false),
40 : basic_blocks_(false),
41 : exclude_bb_padding_(false),
42 E : fuzz_(false) {
43 E : }
44 :
45 : // @name Implementation of the AppImplBase interface.
46 : // @{
47 : bool ParseCommandLine(const CommandLine* command_line);
48 : bool SetUp();
49 : int Run();
50 : // @}
51 :
52 : protected:
53 : // @name Utility members.
54 : // @{
55 : bool Usage(const CommandLine* command_line,
56 : const base::StringPiece& message) const;
57 : // @}
58 :
59 : // @name Command-line parameters.
60 : // @{
61 : base::FilePath input_image_path_;
62 : base::FilePath input_pdb_path_;
63 : base::FilePath output_image_path_;
64 : base::FilePath output_pdb_path_;
65 : base::FilePath order_file_path_;
66 : uint32 seed_;
67 : size_t padding_;
68 : bool no_augment_pdb_;
69 : bool compress_pdb_;
70 : bool no_strip_strings_;
71 : bool output_metadata_;
72 : bool overwrite_;
73 : bool basic_blocks_;
74 : bool exclude_bb_padding_;
75 : bool fuzz_;
76 : // @}
77 :
78 : private:
79 : DISALLOW_COPY_AND_ASSIGN(RelinkApp);
80 : };
81 :
82 : } // namespace relink
83 :
84 : #endif // SYZYGY_RELINK_RELINK_APP_H_
|