void
set_write_corpus_path(write_context& ctxt, bool flag);
+void
+set_write_comp_dir(write_context& ctxt, bool flag);
+
/// A convenience generic function to set common options (usually used
/// by Libabigail tools) from a generic options carrying-object, into
/// a given @ref write_context.
set_show_locs(ctxt, opts.show_locs);
set_write_architecture(ctxt, opts.write_architecture);
set_write_corpus_path(ctxt, opts.write_corpus_path);
+ set_write_comp_dir(ctxt, opts.write_comp_dir);
}
void
bool m_show_locs;
bool m_write_architecture;
bool m_write_corpus_path;
+ bool m_write_comp_dir;
mutable type_ptr_map m_type_id_map;
mutable type_ptr_set_type m_emitted_type_set;
type_ptr_set_type m_emitted_decl_only_set;
m_annotate(false),
m_show_locs(true),
m_write_architecture(true),
- m_write_corpus_path(true)
+ m_write_corpus_path(true),
+ m_write_comp_dir(true)
{}
/// Getter of the environment we are operating from.
set_write_corpus_path(bool f)
{m_write_corpus_path = f;}
+ /// Getter of the comp-dir-path option.
+ ///
+ /// @return true iff compilation dir information shall be emitted
+ bool
+ get_write_comp_dir()
+ {return m_write_comp_dir;}
+
+ /// Setter of the comp-dir-path option
+ ///
+ /// @param f the new value of the flag.
+ void
+ set_write_comp_dir(bool f)
+ {m_write_comp_dir = f;}
+
+
/// Getter of the "show-locs" option.
///
/// When this option is true then the XML writer emits location
set_write_corpus_path(write_context& ctxt, bool flag)
{ctxt.set_write_corpus_path(flag);}
+/// Set the 'write-comp-dir' flag.
+///
+/// When this flag is set then the XML writer will emit compilation dir
+/// information
+///
+/// @param ctxt the context to set this flag on to.
+///
+/// @param flag the new value of the 'write-comp-dir' flag.
+void
+set_write_comp_dir(write_context& ctxt, bool flag)
+{ctxt.set_write_comp_dir(flag);}
+
/// Serialize a translation unit to an output stream.
///
/// @param ctxt the context of the serialization. It contains e.g,
if (!tu.get_path().empty())
o << " path='" << xml::escape_xml_string(tu.get_path()) << "'";
- if (!tu.get_compilation_dir_path().empty())
+ if (!tu.get_compilation_dir_path().empty() && ctxt.get_write_comp_dir())
o << " comp-dir-path='"
<< xml::escape_xml_string(tu.get_compilation_dir_path()) << "'";
bool show_base_name_alt_debug_info_path;
bool write_architecture;
bool write_corpus_path;
+ bool write_comp_dir;
bool load_all_types;
bool linux_kernel_mode;
bool corpus_group_for_linux;
show_base_name_alt_debug_info_path(),
write_architecture(true),
write_corpus_path(true),
+ write_comp_dir(true),
load_all_types(),
linux_kernel_mode(true),
corpus_group_for_linux(false),
<< " --no-architecture do not emit architecture info in the output\n"
<< " --no-corpus-path do not take the path to the corpora into account\n"
<< " --no-show-locs do not show location information\n"
+ << " --no-comp-dir-path do not show compilation path information\n"
<< " --check-alternate-debug-info <elf-path> check alternate debug info "
"of <elf-path>\n"
<< " --check-alternate-debug-info-base-name <elf-path> check alternate "
opts.write_corpus_path = false;
else if (!strcmp(argv[i], "--no-show-locs"))
opts.show_locs = false;
+ else if (!strcmp(argv[i], "--no-comp-dir-path"))
+ opts.write_comp_dir = false;
else if (!strcmp(argv[i], "--check-alternate-debug-info")
|| !strcmp(argv[i], "--check-alternate-debug-info-base-name"))
{