m4_define([version_major], [1])
m4_define([version_minor], [0])
-m4_define([version_revision],[0])
+m4_define([version_revision],[rc0])
AC_INIT([libabigail],
[version_major.version_minor.version_revision],
Display a short help about the command and exit.
+ * `--version | -v`
+
+ Display the version of the program and exit.
+
* ``--list-undefined-symbols | -u``
Display the list of undefined symbols of the application and exit.
Display a short help about the command and exit.
+ * `--version | -v`
+
+ Display the version of the program and exit.
+
* ``--debug-info-dir1 | --d1`` <*di-path1*>
For cases where the debug information for *first-shared-library*
Display a short help about the command and exit.
+ * `--version | -v`
+
+ Display the version of the program and exit.
+
* ``--debug-info-dir | -d`` <*dir-path*>
In cases where the debug info for *path-to-elf-file* is in a
Display a short help message and exits.
+ * `--version | -v`
+
+ Display the version of the program and exit.
+
* ``--debug-info-dir`` <*path*>
When reading an `ELF`_ input file which debug information is split
Display a short help about the command and exit.
+ * `--version | -v`
+
+ Display the version of the program and exit.
+
* ``--debug-info-pkg1 | --d1`` <path>
For cases where the debug information for *package1* is split out
/// This type abstracts the configuration information of the library.
class config
{
- unsigned char m_format_minor;
- unsigned char m_format_major;
- unsigned m_xml_element_indent;
- std::string m_tu_instr_suffix;
- std::string m_tu_instr_archive_suffix;
+ std::string m_format_minor;
+ std::string m_format_major;
+ unsigned m_xml_element_indent;
+ std::string m_tu_instr_suffix;
+ std::string m_tu_instr_archive_suffix;
public:
config();
- unsigned char
+ const std::string&
get_format_minor_version_number() const;
void
- set_format_minor_version_number(unsigned char);
+ set_format_minor_version_number(const std::string& v);
- unsigned char
+ const std::string&
get_format_major_version_number() const;
void
- set_format_major_version_number(unsigned char);
+ set_format_major_version_number(const std::string& v);
unsigned
get_xml_element_indent() const;
///
/// \param rev the revision version number of the library.
void
- abigail_get_library_version(int& maj, int& min, int& rev);
+ abigail_get_library_version(std::string& maj,
+ std::string& min,
+ std::string& rev);
}
}//end namespace abigail
#ifndef __ABG_VERSION_H__
#define __ABG_VERSION_H__
-#define ABIGAIL_VERSION_MAJOR @VERSION_MAJOR@
-#define ABIGAIL_VERSION_MINOR @VERSION_MINOR@
-#define ABIGAIL_VERSION_REVISION @VERSION_REVISION@
+#define ABIGAIL_VERSION_MAJOR "@VERSION_MAJOR@"
+#define ABIGAIL_VERSION_MINOR "@VERSION_MINOR@"
+#define ABIGAIL_VERSION_REVISION "@VERSION_REVISION@"
#endif
namespace abigail
{
config::config()
-: m_format_minor(0), m_format_major(1),
- m_xml_element_indent(2),
- m_tu_instr_suffix(".bi"),
- m_tu_instr_archive_suffix (".abi")
-{ }
+ : m_format_minor("0"),
+ m_format_major("1"),
+ m_xml_element_indent(2)
+{
+ m_tu_instr_suffix = ".bi" ;
+ m_tu_instr_archive_suffix = ".abi";
+}
-unsigned char
+const std::string&
config::get_format_minor_version_number() const
-{ return m_format_minor; }
+{return m_format_minor;}
void
-config::set_format_minor_version_number(unsigned char v)
-{ m_format_minor = v; }
+config::set_format_minor_version_number(const std::string& v)
+{m_format_minor = v;}
-unsigned char
+const std::string&
config::get_format_major_version_number() const
-{ return m_format_major; }
+{return m_format_major;}
void
-config::set_format_major_version_number(unsigned char v)
-{ m_format_major= v; }
+config::set_format_major_version_number(const std::string& v)
+{m_format_major= v;}
unsigned
config::get_xml_element_indent() const
void
config::set_xml_element_indent(unsigned indent)
-{ m_xml_element_indent = indent; }
+{m_xml_element_indent = indent;}
const std::string&
config::get_tu_instr_suffix() const
-{ return m_tu_instr_suffix; }
+{return m_tu_instr_suffix;}
void
config::set_tu_instr_suffix(const std::string& s)
-{ m_tu_instr_suffix = s; }
+{m_tu_instr_suffix = s;}
const std::string&
config::get_tu_instr_archive_suffix() const
-{ return m_tu_instr_archive_suffix; }
+{return m_tu_instr_archive_suffix;}
void
config::set_tu_instr_archive_suffix(const std::string& s)
-{ m_tu_instr_archive_suffix = s; }
+{m_tu_instr_archive_suffix = s; }
extern "C"
{
void
-abigail_get_library_version(int& major, int& minor, int& revision)
+abigail_get_library_version(std::string& major,
+ std::string& minor,
+ std::string& revision)
{
major = ABIGAIL_VERSION_MAJOR;
minor = ABIGAIL_VERSION_MINOR;
do_indent(o, indent);
o << "<abi-instr version='"
- << static_cast<int> (c.get_format_major_version_number())
- << "." << static_cast<int>(c.get_format_minor_version_number())
+ << c.get_format_major_version_number()
+ << "." << c.get_format_minor_version_number()
<< "'";
if (tu.get_address_size() != 0)
#include <iostream>
#include <fstream>
#include <tr1/memory>
+#include "abg-config.h"
#include "abg-tools-utils.h"
#include "abg-corpus.h"
#include "abg-dwarf-reader.h"
shared_ptr<char> lib2_di_root_path;
vector<string> suppression_paths;
bool display_help;
+ bool display_version;
bool weak_mode;
bool list_undefined_symbols_only;
bool show_base_names;
options()
:display_help(),
+ display_version(),
weak_mode(),
list_undefined_symbols_only(),
show_base_names(),
<< "\n"
<< " where options can be: \n"
<< " --help|-h display this help message\n"
+ << " --version|-v show program version information and exit\n"
<< " --list-undefined-symbols|-u display the list of "
"undefined symbols of the application\n"
<< " --show-base-names|b in the report, only show the base names "
else
return false;
}
+ else if (!strcmp(argv[i], "--version")
+ || !strcmp(argv[i], "-v"))
+ {
+ opts.display_version = true;
+ return true;
+ }
else if (!strcmp(argv[i], "--list-undefined-symbols")
|| !strcmp(argv[i], "-u"))
opts.list_undefined_symbols_only = true;
| abigail::tools_utils::ABIDIFF_ERROR);
}
+ if (opts.display_version)
+ {
+ string major, minor, revision;
+ abigail::abigail_get_library_version(major, minor, revision);
+ cout << major << "." << minor << "." << revision << "\n";
+ return 0;
+ }
+
assert(!opts.app_path.empty());
if (!abigail::tools_utils::check_file(opts.app_path, cerr))
return abigail::tools_utils::ABIDIFF_ERROR;
#include <vector>
#include <string>
#include <iostream>
+#include "abg-config.h"
#include "abg-comp-filter.h"
#include "abg-tools-utils.h"
#include "abg-reader.h"
struct options
{
bool display_usage;
+ bool display_version;
bool missing_operand;
string file1;
string file2;
options()
: display_usage(),
+ display_version(),
missing_operand(),
no_arch(),
show_stats_only(),
{
out << "usage: " << prog_name << " [options] [<file1> <file2>]\n"
<< " where options can be:\n"
+ << " --version|-v display program version information and exit\n"
<< " --debug-info-dir1|--d1 <path> the root for the debug info of file1\n"
<< " --debug-info-dir2|--d2 <path> the root for the debug info of file2\n"
<< " --help|-h display this message\n "
else
return false;
}
+ else if (!strcmp(argv[i], "--version")
+ || !strcmp(argv[i], "-v"))
+ {
+ opts.display_version = true;
+ return true;
+ }
else if (!strcmp(argv[i], "--debug-info-dir1")
|| !strcmp(argv[i], "--d1"))
{
| abigail::tools_utils::ABIDIFF_ERROR);
}
+ if (opts.display_version)
+ {
+ string major, minor, revision;
+ abigail::abigail_get_library_version(major, minor, revision);
+ cout << major << "." << minor << "." << revision << "\n";
+ return 0;
+ }
+
abidiff_status status = abigail::tools_utils::ABIDIFF_OK;
if (!opts.file1.empty() && !opts.file2.empty())
{
#include <iostream>
#include <fstream>
#include <tr1/memory>
+#include "abg-config.h"
#include "abg-tools-utils.h"
#include "abg-corpus.h"
#include "abg-dwarf-reader.h"
string in_file_path;
string out_file_path;
shared_ptr<char> di_root_path;
+ bool display_version;
bool check_alt_debug_info_path;
bool show_base_name_alt_debug_info_path;
bool write_architecture;
bool abidiff;
options()
- : check_alt_debug_info_path(),
+ : display_version(),
+ check_alt_debug_info_path(),
show_base_name_alt_debug_info_path(),
write_architecture(true),
load_all_types(),
{
out << "usage: " << prog_name << " [options] [<path-to-elf-file>]\n"
<< " where options can be: \n"
- << " --help|-h display this message\n"
- << " --debug-info-dir|-d <dir-path> look for debug info under 'dir-path'\n"
- << " --out-file <file-path> write the output to 'file-path'\n"
- << " --noout do not emit anything after reading the binary\n"
- << " --no-architecture do not emit architecture info in the output\n"
- << " --check-alternate-debug-info <elf-path> check alternate debug info "
+ << " --help|-h display this message\n"
+ << " --version|-v display program version information and exit\n"
+ << " --debug-info-dir|-d <dir-path> look for debug info under 'dir-path'\n"
+ << " --out-file <file-path> write the output to 'file-path'\n"
+ << " --noout do not emit anything after reading the binary\n"
+ << " --no-architecture do not emit architecture info in the output\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 "
+ << " --check-alternate-debug-info-base-name <elf-path> check alternate "
"debug info of <elf-path>, and show its base name\n"
- << " --load-all-types read all types including those not reachable from"
+ << " --load-all-types read all types including those not reachable from"
"exported declarations\n"
- << " --abidiff compare the loaded ABI against itself\n"
+ << " --abidiff compare the loaded ABI against itself\n"
<< " --stats show statistics about various internal stuff\n";
;
}
else
return false;
}
+ else if (!strcmp(argv[i], "--version")
+ || !strcmp(argv[i], "-v"))
+ {
+ opts.display_version = true;
+ return true;
+ }
else if (!strcmp(argv[i], "--debug-info-dir")
|| !strcmp(argv[i], "-d"))
{
return 1;
}
+ if (opts.display_version)
+ {
+ string major, minor, revision;
+ abigail::abigail_get_library_version(major, minor, revision);
+ cout << major << "." << minor << "." << revision << "\n";
+ return 0;
+ }
+
assert(!opts.in_file_path.empty());
if (!abigail::tools_utils::check_file(opts.in_file_path, cerr))
return 1;
#include <string>
#include <iostream>
#include <fstream>
+#include "abg-config.h"
#include "abg-tools-utils.h"
#include "abg-ir.h"
#include "abg-corpus.h"
struct options
{
string file_path;
+ bool display_version;
bool read_from_stdin;
bool read_tu;
bool diff;
std::tr1::shared_ptr<char> di_root_path;
options()
- : read_from_stdin(false),
+ : display_version(false),
+ read_from_stdin(false),
read_tu(false),
diff(false),
noout(false)
out << "usage: " << prog_name << " [options] [<abi-file1>]\n"
<< " where options can be:\n"
<< " --help display this message\n"
+ << " --version|-v display program version information and exit\n"
<< " --debug-info-dir <path> the path under which to look for "
"debug info for the elf <abi-file>\n"
<< " --diff for xml inputs, perform a text diff between "
}
else if (!strcmp(argv[i], "--help"))
return false;
+ else if (!strcmp(argv[i], "--version")
+ || !strcmp(argv[i], "-v"))
+ {
+ opts.display_version = true;
+ return true;
+ }
else if (!strcmp(argv[i], "--debug-info-dir"))
{
if (argc <= i + 1
return true;
}
+ if (opts.display_version)
+ {
+ string major, minor, revision;
+ abigail::abigail_get_library_version(major, minor, revision);
+ cout << major << "." << minor << "." << revision << "\n";
+ return 0;
+ }
abigail::ir::environment_sptr env(new abigail::ir::environment);
if (opts.read_from_stdin)
{
#include <elfutils/libdw.h>
#include <unistd.h>
#include <pthread.h>
+#include "abg-config.h"
#include "abg-tools-utils.h"
#include "abg-comparison.h"
#include "abg-dwarf-reader.h"
struct options
{
bool display_usage;
+ bool display_version;
bool missing_operand;
bool abignore;
bool parallel;
options()
: display_usage(),
+ display_version(),
missing_operand(),
abignore(true),
parallel(true),
<< " --no-parallel do not execute in parallel\n"
<< " --fail-no-dbg fail if no debug info was found\n"
<< " --verbose emit verbose progress messages\n"
- << " --help|-h display this help message\n";
+ << " --help|-h display this help message\n"
+ << " --version|-v display program version information"
+ " and exit\n";
}
#ifdef WITH_RPM
opts.display_usage = true;
return true;
}
+ else if (!strcmp(argv[i], "--version")
+ || !strcmp(argv[i], "-v"))
+ {
+ opts.display_version = true;
+ return true;
+ }
else
return false;
}
return 1;
}
+ if (opts.display_version)
+ {
+ string major, minor, revision;
+ abigail::abigail_get_library_version(major, minor, revision);
+ cout << major << "." << minor << "." << revision << "\n";
+ return 0;
+ }
+
if (opts.package1.empty() || opts.package2.empty())
{
cerr << "Please enter two packages to compare" << "\n";
#include <cstring>
#include <iostream>
#include <sstream>
+#include "abg-config.h"
#include "abg-dwarf-reader.h"
#include "abg-ir.h"
struct options
{
bool show_help;
+ bool display_version;
char* elf_path;
char* symbol_name;
bool demangle;
options()
: show_help(false),
+ display_version(false),
elf_path(0),
symbol_name(0),
demangle(false),
display_usage(const string& prog_name, ostream &out)
{
out << "usage: " << prog_name << " [options] <elf file> <symbol-name>\n"
- << "where [options] can be:\n"
- << " --help display this help string\n"
- << " --demangle demangle the symbols from the symbol table\n"
- << " --no-absolute-path do not show absolute paths in messages\n";
+ << "where [options] can be:\n"
+ << " --help display this help string\n"
+ << " --version|-v display program version information and exit\n"
+ << " --demangle demangle the symbols from the symbol table\n"
+ << " --no-absolute-path do not show absolute paths in messages\n";
}
static void
opts.show_help = true;
return;
}
+ else if (!strcmp(argv[i], "--version")
+ || !strcmp(argv[i], "-v"))
+ {
+ opts.display_version = true;
+ return;
+ }
else if (!strcmp(argv[i], "--demangle"))
opts.demangle = true;
else if (!strcmp(argv[i], "--no-absolute-path"))
display_usage(argv[0], cout);
return 1;
}
+
+ if (opts.display_version)
+ {
+ string major, minor, revision;
+ abigail::abigail_get_library_version(major, minor, revision);
+ cout << major << "." << minor << "." << revision << "\n";
+ return 0;
+ }
+
assert(opts.elf_path != 0
&& opts.symbol_name != 0);