blob: a5bd99284ec66beb8e5ac22be6715300aa219483 [file] [log] [blame]
David Sehr7629f602016-08-07 16:01:51 -07001/*
2 * Copyright (C) 2016 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 *
16 * Header file of the dexlayout utility.
17 *
18 * This is a tool to read dex files into an internal representation,
19 * reorganize the representation, and emit dex files with a better
20 * file layout.
21 */
22
23#ifndef ART_DEXLAYOUT_DEXLAYOUT_H_
24#define ART_DEXLAYOUT_DEXLAYOUT_H_
25
26#include <stdint.h>
27#include <stdio.h>
28
29namespace art {
30
David Sehrcdcfde72016-09-26 07:44:04 -070031class ProfileCompilationInfo;
32
David Sehr7629f602016-08-07 16:01:51 -070033/* Supported output formats. */
34enum OutputFormat {
35 kOutputPlain = 0, // default
36 kOutputXml, // XML-style
37};
38
39/* Command-line options. */
40struct Options {
41 bool build_dex_ir_;
42 bool checksum_only_;
43 bool disassemble_;
44 bool exports_only_;
45 bool ignore_bad_checksum_;
David Sehr7629f602016-08-07 16:01:51 -070046 bool show_annotations_;
David Sehr7629f602016-08-07 16:01:51 -070047 bool show_file_headers_;
48 bool show_section_headers_;
49 bool verbose_;
David Sehrcdcfde72016-09-26 07:44:04 -070050 bool visualize_pattern_;
David Sehr7629f602016-08-07 16:01:51 -070051 OutputFormat output_format_;
Jeff Haoa8621002016-10-04 18:13:44 +000052 const char* output_dex_directory_;
David Sehr7629f602016-08-07 16:01:51 -070053 const char* output_file_name_;
David Sehrcdcfde72016-09-26 07:44:04 -070054 const char* profile_file_name_;
David Sehr7629f602016-08-07 16:01:51 -070055};
56
57/* Prototypes. */
58extern struct Options options_;
59extern FILE* out_file_;
David Sehrcdcfde72016-09-26 07:44:04 -070060extern ProfileCompilationInfo* profile_info_;
David Sehr7629f602016-08-07 16:01:51 -070061int ProcessFile(const char* file_name);
62
63} // namespace art
64
65#endif // ART_DEXLAYOUT_DEXLAYOUT_H_