pygccxml.binary_parsers API

Overview

contains classes that allows to extract different information from binary files ( .map, .dll, .so ) and integrate it with existing declarations tree

The main function of this package is pygccxml.binary_parsers.parsers.merge_information().

pygccxml.binary_parsers.format_decl(decl, hint=None)
returns string, that represents formatted declaration, according to some rules :param hint: valid values are: “msvc” and “nm”
pygccxml.binary_parsers.undecorate_blob(blob)
returns undecoratedunmangled string, created from blob(exported symbol name)

Modules

parsers

defines few simple classes( parsers ), which deals with .dll, .map, .so files.

Those classes extract decoratedmangled names from the files. Later the extracted symbols are used for:

  • building “dynamic library” public interface
  • extracting function calling convention
exception pygccxml.binary_parsers.parsers.LicenseWarning(*args, **keywd)
Bases: exceptions.UserWarning
class pygccxml.binary_parsers.parsers.dll_file_parser_t(global_ns, map_file_path)

Bases: pygccxml.binary_parsers.parsers.formated_mapping_parser_t

parser for Windows .dll file

load_symbols()
merge(smbl)
class pygccxml.binary_parsers.parsers.formated_mapping_parser_t(global_ns, binary_file, hint)

Bases: pygccxml.binary_parsers.parsers.libparser_t

convenience class, which formats existing declarations

formated_decls
class pygccxml.binary_parsers.parsers.libparser_t(global_ns, binary_file)

Bases: object

base class for .dll, .map, .so parser classes

global_ns - reference to global namespace binary_file - s

binary_file
binary file path
global_ns
reference to global namespace
load_symbols()

loads public( shared ) symbols from the binary file.

This method should be overridden in the derived classes.

loaded_symbols
list of symbols, which were loaded from the binary file. The actual type of return value defined by the derived class
merge(symbol)

extracts and merges information from the symbol to the declarations tree.

This method should be overridden in the derived classes.

parse()

the main method of the class

loads information from the binary file and merges it into the declarations tree.

The return value of the function is dictionary, where the key is decorated/mangled declaration name and the value is a declaration.

class pygccxml.binary_parsers.parsers.map_file_parser_t(global_ns, map_file_path)

Bases: pygccxml.binary_parsers.parsers.formated_mapping_parser_t

parser for MSVC .map file

load_symbols()
returns dictionary { decorated symbol : original declaration name }
merge(smbl)
pygccxml.binary_parsers.parsers.merge_information(global_ns, fname, runs_under_unittest=False)
high level function - select the appropriate binary file parser and integrates the information from the file to the declarations tree.
class pygccxml.binary_parsers.parsers.so_file_parser_t(global_ns, binary_file)

Bases: pygccxml.binary_parsers.parsers.formated_mapping_parser_t

parser for Linux .so file

load_symbols()
merge(smbl)
blog comments powered by Disqus

Table Of Contents

Previous topic

pygccxml.parser package

Next topic

pygccxml.utils package

This Page