77"""
88defines few simple classes( parsers ), which deals with .dll, .map, .so files.
99
10- Those classes extract decorated\mangled names from the files. Later, they undecorate
11- the name and extract the functions calling convention.
10+ Those classes extract decorated\mangled names from the files. Later the extracted
11+ symbols are used for:
12+ * building "dynamic library" public interface
13+ * extracting function calling convention
1214"""
1315
1416import os
@@ -80,13 +82,13 @@ def merge( self, symbol):
8082 raise NotImplementedError ()
8183
8284 def parse ( self ):
83- """main class method
85+ """the main method of the class
8486
8587 loads information from the binary file and merges it into the declarations
8688 tree.
8789
88- The return value of the function is dictionary, where key is decorated
89- declaration name and value is a declaration.
90+ The return value of the function is dictionary, where the key is
91+ decorated/mangled declaration name and the value is a declaration.
9092 """
9193 self .__loaded_symbols = self .load_symbols ()
9294 result = {}
@@ -103,7 +105,7 @@ def parse( self ):
103105CCTS = declarations .CALLING_CONVENTION_TYPES
104106
105107class formated_mapping_parser_t ( libparser_t ):
106- """base parser class for few MSVC binary files """
108+ """convenience class, which formats existing declarations """
107109 def __init__ ( self , global_ns , binary_file , hint ):
108110 libparser_t .__init__ ( self , global_ns , binary_file )
109111 self .__formated_decls = {}
@@ -209,6 +211,7 @@ def merge( self, smbl ):
209211
210212
211213class so_file_parser_t ( formated_mapping_parser_t ):
214+ """parser for Linux .so file"""
212215 nm_executable = 'nm'
213216 #numeric-sort used for mapping between mangled and unmangled name
214217 cmd_mangled = '%(nm)s --extern-only --dynamic --defined-only --numeric-sort %(lib)s'
0 commit comments