third_party/bloaty/src/main.cc
Go to the documentation of this file.
1 // Copyright 2016 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 "bloaty.h"
16 #include "bloaty.pb.h"
17 
18 #include <iostream>
19 
20 int main(int argc, char *argv[]) {
21  bloaty::Options options;
22  bloaty::OutputOptions output_options;
24  if (!bloaty::ParseOptions(false, &argc, &argv, &options, &output_options,
25  &error)) {
26  if (!error.empty()) {
27  fprintf(stderr, "bloaty: %s\n", error.c_str());
28  return 1;
29  } else {
30  return 0; // --help or similar.
31  }
32  }
33 
35  bloaty::MmapInputFileFactory mmap_factory;
36  if (!bloaty::BloatyMain(options, mmap_factory, &output, &error)) {
37  if (!error.empty()) {
38  fprintf(stderr, "bloaty: %s\n", error.c_str());
39  }
40  return 1;
41  }
42 
43  if (!options.dump_raw_map()) {
44  output.Print(output_options, &std::cout);
45  }
46  return 0;
47 }
options
double_dict options[]
Definition: capstone_test.c:55
bloaty.h
testing::internal::string
::std::string string
Definition: bloaty/third_party/protobuf/third_party/googletest/googletest/include/gtest/internal/gtest-port.h:881
error
grpc_error_handle error
Definition: retry_filter.cc:499
bloaty::BloatyMain
bool BloatyMain(const Options &options, const InputFileFactory &file_factory, RollupOutput *output, std::string *error)
Definition: bloaty.cc:2196
bloaty::RollupOutput
Definition: bloaty.h:376
python_utils.port_server.stderr
stderr
Definition: port_server.py:51
gmock_output_test.output
output
Definition: bloaty/third_party/googletest/googlemock/test/gmock_output_test.py:175
bloaty::OutputOptions
Definition: bloaty.h:370
bloaty::ParseOptions
bool ParseOptions(bool skip_unknown, int *argc, char **argv[], Options *options, OutputOptions *output_options, std::string *error)
Definition: bloaty.cc:2138
main
int main(int argc, char *argv[])
Definition: third_party/bloaty/src/main.cc:20
bloaty::MmapInputFileFactory
Definition: bloaty.h:96


grpc
Author(s):
autogenerated on Fri May 16 2025 02:59:17