Libtodb
From ISP_RAS
Contents |
Description
LibToDB tool speeds up the addition of new library into LSB Database. It check debuggable dynamic library against the LSB database and can actually write elements of the library into the LSB database.
The full description of libtodb can be found on its page.
'libtodb' script is stored in LSB CVS, in /tools/scripts/. There are also some scripts in /tools/scripts/ that use LibToDB:
| Script | Description |
|---|---|
| addfontconfig.sh | adds information from fontconfig.h header to database; uses libtodb |
| addimage.sh | adds information about fontconfig, libpng and libjpeg to database; uses libtodb |
| addgtk.sh | adds information about Gtk libraries to database; uses libtodb |
| addxml2.sh | adds information about libxml2 to database; uses libtodb |
These scripts use addTypes.pl script that adds the given types to the database.
In new Bazaar repository libtodb and add* scripts are stored in 'scripts' directory.
Usage
add*.sh scripts
add*.sh scripts have no arguments
addTypes.pl
addTypes.pl headerName typeListFile [hostArch] headerName Theadgroup for all added types will be set to the default header group of this header typeListFile List of type names that should be added t othe database (type name per line) hostArch Tarch for all added types will be set to this value (hostArch should be a valid Aid from Architecture table). The default value is 2 (IA32)
libtodb
libtodb [options] filename
filename Filename of library to scan.
-h|--help Display help message
-d|--DB db_name Database name
-u|--user username Name of user for db access
-p|--password password Password for db access
-m|--host hostname Hostname for DB
-r|--report Report only (defualt)
-i|--insert Insert interfaces: if the DB does not contain an
interface named in <filename>, add that interface to the
database.
-H|--header name Specify header name, which will be used by application
when developing a library, The file name has to be
relative to /usr/include. This is required when
inserting interfaces into DB.
-S|--soname name This is run time library name of .so file.. This is
required when inserting interfaces into DB.
-L|--libgroup name This option is used to specify the LibGroup Name. This
is optional when inserting interfaces into DB. Default
will take if not specified.
-q|--quiet When inserting interfaces, don't make lots of output.
-a|--arch arch Architecture to match in the database
-A|--hostarch arch Architecture of host machine, where given library is
build This architecture is used to enter size and offset
data of different datatype.
-e|--regexp regexp Only process interfaces matching this regular expression
-x|--exclude filename List of exclude interface, list one interface per line
in a file. Specify path of that file.
-X|--extype filename List of data type which should be excluded from
inclusion while adding missing data type from DWARF,
list one interface per line in a file. Specify path of
that file (File name is optional, switch required to
enable this feature).
-T|--inctype filename List of data types to be added explicitly, opsite to -X
option. Specify path of that file.
-o|--opaque filename List of data type, which appears as opaque reference in
header file. One DB entry will be created with status
set as "Excluded", list one interface per line in a
file. Specify path of that file.
-l|--include filename List of include interface, list one interface per line
in a file. Specify path of that file.
-s|--standard <DBi> This switch is mandatory switch and used to specify
which Standard (either an FSG approved spec, an ISO
spec, an IETF RFC on the standards track or from an
organization in liaison with ISO) defines the Interface
or Interfaces entered using this tool. DB index (DBi)
is a index value of standard entry, can be found from
specdb/Standard.init file, if standard DOESN'T EXIST
THEN CREATE ONE IN THIS FILE AND RELOAD YOUR DB BEFORE
USING THIS TOOL. If NO standard defined for an interface
then use LSB STANDARD, index value of LSB is 10.
-M|--module <DBi> This switch is mandatory and used to specify which
Module this library belongs. DB index (DBi) is a index
value of Module entry in specdb/Module.init file. if
entry DOESN'T EXIST THEN CREATE ONE IN THIS FILE AND
RELOAD THE DATABASE BEFORE USING THIS TOOL. e.g
LSB_Core Module has index value 1.
-c|--const filename List all the #define in a file in a given specific
format, format should be
<type>#define identifier token-sequence or
<type>#define identifier (identifier-list) token-seq.
Here <type> is as defined in the database
Constants.Ctype field. Default value of type is int if
type is not defined in angle bracket.
e.g. <>#define MAX 256
Dependencies on DB
libtodb
| Table | Insert | Select |
|---|---|---|
| ArchConst | + | + |
| Architecture | - | + |
| ArchLib | + | + |
| ArchType | + | + |
| Constant | + | + |
| Header | + | + |
| HeaderGroup | + | + |
| Interface | + | + |
| LGInt | + | + |
| LibGroup | + | + |
| Library | + | + |
| ModLib | + | + |
| Module | - | + |
| Parameter | + | + |
| Standard | - | + |
| Type | + | + |
| TypeMember | + | + |
addfontconfig.sh
This tool simply calls libtodb script, it doesn't deal with database directly.
addgtk.sh
This tool uses libtodb add addType.pl scripts.
| Table | Insert | Select |
|---|---|---|
| ArchType | + | - |
| Interface | - | + |
addimage.sh
This tool uses libtodb add addType.pl scripts.
| Table | Insert | Select |
|---|---|---|
| ArchType | + | - |
| Interface | - | + |
addxml2.sh
This tool uses libtodb add addType.pl scripts.
| Table | Insert | Select |
|---|---|---|
| ArchType | + | - |
| Interface | - | + |
| Type | - | + |
addTypes.pl
| Table | Insert | Select |
|---|---|---|
| ArchType | + | - |
| HeaderGroup | - | + |
| TypeMember | + | + |
| Type | - | + |