listdbr utility

WSupported on Windows
USupported on Unix

 

 

The listdbr utility displays information about the routines and global data (including initial contents) in the specified executable program(s). It also displays the names of external routines and global data referenced by each of those routines. Listdbr also displays that same information for each of the ELBs linked to the specified executable program(s) and any ELBs linked to those ELBs.

Tip

If you are interested only in the ELB contents, run the listelb utility instead. It provides easier-to-read output for ELBs.

You must run the version of listdbr that has the same bitness as the .dbr file you are examining; else, you’ll get the error “filename DBR file built with opposite bit size.”

Listdbr has the following syntax:

listdbr [option] exec_file [...]

option

(optional) One or more of the following:

-e

Display a list of linked ELBs only.

-f

For each routine, show the MDB flags, the compilation version, and all routines that are called, as well as the link version, endian type (LTLNDN or BIGNDN), and bit size of the .dbr or .elb file. (See Synergex KnowledgeBase article 2324 for more information about MDB flags.)

-g

Display global data. This is the default option and is the same as not specifying any options.

-h

Display usage information.

-i

Display the version of the linker (in the file header) used to create the .dbr file.

-m

Show the module descriptor block of each routine. (The module descriptor block contains descriptive information about the routine, such as the routine name, program section offsets, and program section lengths.)

-v

Turn off verbose output. Provides an abbreviate list of the ELB’s contents.

-x

Include list of additional ELBs on the command line. Listdbr loads every module in the main routine and the specified ELBs (including any ELBs linked to those ELBs) to see if any modules are undefined, which would cause an error at runtime if the module were dynamically loaded. Undefined modules will result in a “Bad ELB elbname” message.

exec_file

One or more executable programs (.dbr) for which you want to display information. If -x is specified, you can specify one executable program followed by one or more ELBs.

Discussion

When run without any options (or with -g), listdbr displays information about each routine in the executable file, including which external routines it links to. It also displays the ELBs linked to the executable, and details regarding all the routines in them, including any external routines that they link to.

For example, here are the first few lines of the listdbr output for genxml.dbr:

c:\myApps>listdbr genxml.dbr
latest DBR structure
"C:\Program Files\Synergex\SynergyDE\dbl\synxml.elb" latest ELB structure
"C:\Program Files\Synergex\SynergyDE\rps\lib\ddlib.elb" latest ELB structure
"C:\Program Files\Synergex\SynergyDE\toolkit\tklib.elb" latest ELB structure
1. genxml.dbr (genxml.dbr)
   GLOBAL data: (8 bytes)
      $GDS_OPTIONS  GLOBAL, size  8, "<0><0><0><0><0><0><0><0>"
DD_ERROR  size  352, pos 13014, ext refs  0, gblsiz  0
ENUMDEF_CREATE  size  568, pos 13366, ext refs 26, gblsiz  0
   External routines:
      MEM_PROC
      FIELDLIST_CREATE

This output shows that genxml.dbr links to the ELBs synxml, ddlib, and tklib. Then it displays details about the global data and routines in genxml. The ENUMDEF_CREATE routine links to two external routines, MEM_PROC and FIELDLIST_CREATE.

The listdbr utility outputs a lot of information. To help you navigate it, major sections are numbered. Note the “1.” on line five of the sample output above. The first .dbr on the command line will always be “1.”; in the output for genxml.dbr, you can search on “2.” to jump to the output regarding synxml.elb, search on “3.” to jump to ddlib.elb, and so forth.

At the end of the report you’ll see sections for CLIB, which will list any C routines added to the runtime, and DLIB, which lists the standard XCALLs and functions included in the runtime.

You can see the exit status returned by listdbr utility by running the command “echo %ERRORLEVEL%” (Windows) or “echo $?” (Unix) after running listdbr. The utility returns 0 if there are no undefined subroutines or global data in the executable or in any ELBs accessed by that executable. It returns 1 if some routine or global data item is undefined.

You can use the -x option to find out if your ELB will have runtime failures with xfServerPlus. If there’s a problem, you’ll see the message “Bad ELB elbname.” For example:

c:\myApps>listdbr -v -x DBLDIR:xfpl.dbr myelb.elb
latest DBR structure
"C:\Program Files\Synergex\SynergyDE\dbl\xfpl_api.elb" latest ELB structure
Bad ELB "myelb.elb"
Note

The format and output of listdbr data is subject to change without notice.