Lines Matching defs:opts
244 parse_command_line(int argc, char* argv[], options& opts)
253 if (opts.in_file_path.empty())
254 opts.in_file_path = argv[i];
260 opts.display_version = true;
263 opts.display_abixml_version = true;
272 opts.di_root_paths.push_back
282 opts.headers_dirs.push_back(argv[j]);
291 opts.header_files.push_back(argv[j]);
298 || !opts.out_file_path.empty())
301 opts.out_file_path = argv[i + 1];
310 opts.suppression_paths.push_back(argv[j]);
319 opts.kabi_whitelist_paths.push_back(argv[j]);
324 opts.corpus_group_for_linux = true;
330 opts.vmlinux = argv[j];
334 opts.noout = true;
337 opts.use_ctf = true;
340 opts.write_architecture = false;
342 opts.write_corpus_path = false;
344 opts.show_locs = false;
346 opts.short_locs = true;
348 opts.write_comp_dir = false;
350 opts.write_elf_needed = false;
352 opts.default_sizes = false;
354 opts.write_parameter_names = false;
361 opts.type_id_style = SEQUENCE_TYPE_ID_STYLE;
363 opts.type_id_style = HASH_TYPE_ID_STYLE;
372 || !opts.in_file_path.empty())
375 opts.show_base_name_alt_debug_info_path = true;
376 opts.check_alt_debug_info_path = true;
377 opts.in_file_path = argv[i + 1];
381 opts.load_all_types = true;
383 opts.drop_private_types = true;
385 opts.drop_undefined_syms = true;
387 opts.exported_interfaces_only = true;
389 opts.exported_interfaces_only = false;
391 opts.linux_kernel_mode = false;
393 opts.abidiff = true;
397 opts.abidiff = true;
398 opts.debug_abidiff = true;
404 opts.debug_type_canonicalization = true;
407 opts.debug_die_canonicalization = true;
410 opts.assume_odr_for_cplusplus = false;
412 opts.leverage_dwarf_factorization = false;
414 opts.annotate = true;
416 opts.show_stats = true;
418 opts.do_log = true;
425 opts.wrong_option = argv[i];
452 /// @param opts the options instance to use.
457 maybe_check_suppression_files(const options& opts)
459 for (vector<string>::const_iterator i = opts.suppression_paths.begin();
460 i != opts.suppression_paths.end();
466 opts.kabi_whitelist_paths.begin();
467 i != opts.kabi_whitelist_paths.end();
478 /// @param opts the options instance to use.
482 maybe_check_header_files(const options& opts)
484 for (vector<string>::const_iterator file = opts.header_files.begin();
485 file != opts.header_files.end();
503 /// @param opts the options where to get the suppression
506 set_suppressions(abigail::elf_based_reader& rdr, options& opts)
509 for (vector<string>::const_iterator i = opts.suppression_paths.begin();
510 i != opts.suppression_paths.end();
515 abigail::tools_utils::gen_suppr_spec_from_headers(opts.headers_dirs,
516 opts.header_files);
519 if (opts.drop_private_types)
526 gen_suppr_spec_from_kernel_abi_whitelists(opts.kabi_whitelist_paths);
528 opts.kabi_whitelist_supprs.insert(opts.kabi_whitelist_supprs.end(),
532 rdr.add_suppressions(opts.kabi_whitelist_supprs);
540 /// @param opts the command line options.
542 set_generic_options(abigail::elf_based_reader& rdr, options& opts)
544 rdr.options().drop_undefined_syms = opts.drop_undefined_syms;
545 rdr.options().show_stats = opts.show_stats;
546 rdr.options().do_log = opts.do_log;
548 opts.leverage_dwarf_factorization;
550 opts.assume_odr_for_cplusplus;
560 /// @param opts the options of the program.
567 options& opts)
573 if (opts.debug_abidiff)
578 if (opts.debug_type_canonicalization)
580 if (opts.debug_die_canonicalization)
588 if (opts.use_ctf)
593 // specfied in opts ...
595 create_best_elf_based_reader(opts.in_file_path,
596 opts.prepared_di_root_paths,
598 opts.load_all_types,
599 opts.linux_kernel_mode);
604 set_generic_options(*reader, opts);
605 set_suppressions(*reader, opts);
610 if (opts.check_alt_debug_info_path)
616 if (opts.show_base_name_alt_debug_info_path)
634 if (opts.exported_interfaces_only.has_value())
635 env.analyze_exported_interfaces_only(*opts.exported_interfaces_only);
641 if (opts.do_log)
650 if (opts.do_log)
660 if (opts.di_root_paths.empty())
664 << opts.in_file_path << "\n";
675 << "Could not read debug info for '" << opts.in_file_path
678 opts.di_root_paths.begin();
679 i != opts.di_root_paths.end();
682 if (i != opts.di_root_paths.begin())
691 << opts.in_file_path << "\n";
700 set_common_options(*write_ctxt, opts);
703 if (opts.do_log)
708 if (opts.abidiff)
719 if (opts.debug_abidiff)
721 opts.type_id_file_path = tmp_file->get_path() + string(".typeid");
722 write_canonical_type_ids(*write_ctxt, opts.type_id_file_path);
728 if (opts.debug_abidiff
729 && !opts.type_id_file_path.empty())
730 load_canonical_type_ids(*rdr, opts.type_id_file_path);
736 if (opts.do_log)
750 ctxt->show_locs(opts.show_locs);
754 if (opts.do_log)
764 if (opts.do_log)
773 if (opts.debug_abidiff
774 && !opts.type_id_file_path.empty())
775 remove(opts.type_id_file_path.c_str());
778 if (opts.noout)
781 if (!opts.out_file_path.empty())
783 ofstream of(opts.out_file_path.c_str(), std::ios_base::trunc);
788 << opts.out_file_path << "'\n";
795 if (opts.do_log)
806 if (opts.do_log)
822 /// @param opts the options this program was created with.
829 options& opts)
831 if (!(tools_utils::is_dir(opts.in_file_path) && opts.corpus_group_for_linux))
836 if (!opts.vmlinux.empty())
837 if (!abigail::tools_utils::check_file(opts.vmlinux, cerr, argv[0]))
843 if (opts.exported_interfaces_only.has_value())
844 env.analyze_exported_interfaces_only(*opts.exported_interfaces_only);
846 if (opts.do_log)
854 opts.use_ctf ? corpus::CTF_ORIGIN :
858 build_corpus_group_from_kernel_dist_under(opts.in_file_path,
860 opts.vmlinux,
861 opts.suppression_paths,
862 opts.kabi_whitelist_paths,
863 supprs, opts.do_log, env,
867 if (opts.do_log)
877 if (!opts.noout)
881 set_common_options(*ctxt, opts);
883 if (!opts.out_file_path.empty())
885 ofstream of(opts.out_file_path.c_str(), std::ios_base::trunc);
890 << opts.out_file_path << "'\n";
894 if (opts.do_log)
901 if (opts.do_log)
907 if (opts.do_log)
913 if (opts.do_log)
920 if (opts.do_log)
941 options opts;
943 if (!parse_command_line(argc, argv, opts)
944 || (opts.in_file_path.empty()
945 && !opts.display_version
946 && !opts.display_abixml_version))
948 if (!opts.wrong_option.empty())
950 << "unrecognized option: " << opts.wrong_option << "\n";
955 if (opts.display_version)
963 if (opts.display_abixml_version)
971 ABG_ASSERT(!opts.in_file_path.empty());
972 if (opts.corpus_group_for_linux)
974 if (!abigail::tools_utils::check_dir(opts.in_file_path, cerr, argv[0]))
979 if (!abigail::tools_utils::check_file(opts.in_file_path, cerr, argv[0]))
983 prepare_di_root_paths(opts);
985 if (!maybe_check_suppression_files(opts))
988 if (!maybe_check_header_files(opts))
992 abigail::tools_utils::guess_file_type(opts.in_file_path);
998 << "files of the kind of "<< opts.in_file_path << " are not handled\n";
1005 if (tools_utils::is_regular_file(opts.in_file_path))
1006 exit_code = load_corpus_and_write_abixml(argv, env, opts);
1008 exit_code = load_kernel_corpus_group_and_write_abixml(argv, env, opts);