NAME

     cdb - examine 5ESS/ATM/LSS	code using a Cscope DataBase


SYNOPSIS

     cdb [ options ] [ source files ]


DESCRIPTION

     Cdb is an interactive screen-oriented tool	that helps you:

	  Learn	how 5ESS/ATM/LSS code works without endless flip-
	  ping through a thick listing.

	  Locate the section of	code  to  change  to  fix  a  bug
	  without having to learn the entire 5ESS/ATM/LSS.

	  Examine the effect of	a proposed change such as  adding
	  a value to an	enum variable.

	  Verify that a	change has been	made in	all source  files
	  such as adding an argument to	an existing function.

     It	is designed to answer questions	like:

	  Where	is this	symbol used?
	  Where	is it defined?
	  Where	did this variable get its value?
	  What is this global symbol's definition?
	  Where	is this	function in the	source files?
	  What functions call this function?
	  What functions are called by this function?
	  Where	does this message come from?
	  Where	is this	source file in the directory structure?
	  What processes utilise this function?

     Cdb answers these questions from a	symbol database	 that  is
     built  beforehand by the Program Administration Group (PAG).
     For 5ESS/ATM, you can chose to look at the	built source code
     (called  text)  or	the breakpoint listings	produced after an
     official load build.  In addition,	you can	look  at  private
     changes  by  providing  your  own list of source files.  For
     LSS, you can look at  official  source  code  in  a  similar
     manner  to	 the  way  that	 private  changes  are handled in
     5ESS/ATM.









     For 5ESS/ATM, Cdb will display an entry menu from which  you
     can select	a database to use from these input fields:

	  Database Type:
	  Project:
	  Load:
	  Selector:
	  Owner:
	  Node:
	  Menu Type:

     Press the TAB key repeatedly to move to  the  desired  input
     field  and	 press	the  RETURN key	to make	a selection.  You
     will then be shown	a list of the current  options	for  that
     field  underneath	the  input  fields.  Use the same keys to
     move and select your choice, which	will  then  be	displayed
     next  to  the  input  field  and the list of options will be
     removed.  You can also use	the arrow keys on  your	 terminal
     to	move as	well.

     When using	the entry menu to switch between US and	 Interna-
     tional load lines,	first change the "owner" field (to either
     "cscope" for International	or  "lbteam"  for  US),	 set  the
     default node by hitting RETURN on the "node" field, then set
     the correct project.

     Once you have made	selections in all of  the  input  fields,
     press <^E>	to execute your	selection.  Cdb	will then attempt
     to	access the database. On	the entry menu,	you can	use these
     command characters:

     TAB ^F ^N
	    Move to the	next input field.
     ^B	^P  Move the the previous  input  field	 ^E  Execute  the
	    entry menu form and	enter the selected databases.
     $	    Check news and message of the  day.	 This  will  only
	    print if unread items are available.
     ?	    Give help.
     !	    Start an interactive shell	(type  ^D  to  return  to
	    Cdb).
     '	    Clear field	entry.
     ^L	    Redraw the screen.
     ^A	    Go to first	input field.
     ^V	    Go to last input field.
     ^D	^Z  Exit Cdb.

     If	you have chosen	a subsystem database on	another	 machine,
     Cdb  will	execute	 rexec	to  provide the	RI-CDB "seamless"
     interface,	or will	 execute  rsh  commands	 to  provide  the
     remote interface.	If rexec finds you do not have a login or
     are not authorized	on that	system,	you must  run  "rexec  -s
     authorize"	 and  type a valid login and password to use this
     facility.	For rsh	you must have the ".rhosts" file  set  up
     correctly	for  no	password authorisation checks to be made.
     Also for rsh, if you use a	 different  login  to  your  home
     login,  then  you must set	the RSHLOGIN variable to the name
     of	the login before executing Cdb.

     If	you have already provided selections using  command  line
     options,  Cdb  will auto-execute the options and go directly
     to	the main menu.

     After all Cscope processes	started	in background are  ready,
     Cdb   will	 display  these	 input	fields	for  the  reverse
     engineering menu:

	  Find this C symbol:
	  Find this definition:
	  Find functions called	by this	function:
	  Find functions calling this function:
	  Find seized/granted module definitions:
	  Find use of this type:
	  Find this file:
	  Find processes calling this function:
	  Find symbols in the call tree	of this	function:

     and these fields for the function (cscope)	menu:

	  Find this C symbol:
	  Find this definition:
	  Find functions called	by this	function:
	  Find functions calling this function:
	  Find assignments to:
	  Print	files from this	grep pattern:
	  Find this egrep pattern:
	  Find this file:
	  Find files #including	this file:

     Press the TAB key repeatedly to move to  the  desired  input
     field,  type  the	pattern	to search for, and then	press the
     RETURN key.  For the reverse engineering menu, for	the first
     5	and  last 3 input fields, the pattern can be a regcmp(3X)
     regular expression.  For the function  (cscope)  menu,  this
     applies  to  the  first  5	and last 2 input fields.  For the
     reverse engineering menu, for the last 3 input  fields,  you
     can  enter	a partial string that will be matched (e.g. alloc
     for alloctest.c). For processes, use the subsystem	 category
     code  (e.g.  TM)  to find all definitions in that subsystem.
     For modules, use the subsystem category code  (e.g.  TM)  to
     find all references in that subsystem.  Cdb also allows mul-
     tiple searches separated by spaces	e.g.

	  Find this C symbol: symbol1 symbol2

     This is turned off	for the	 function  menu	 grep  and  egrep
     queries.	Cdb can	also query mutliple databases using a '+'
     separated list of selector	names. Search results are printed
     in	 order,	 so be aware that any <global> files indicate the
     start of results from another  database.	Multiple  queries
     are  applied  to  each (multiple) database	in the order sup-
     plied.

     For the "Find seized/granted module  definitions"	question,
     you will need to supply a module name, which will be used to
     match the file part of the	results. The  seized  definitions
     are  those	 functions  called  directly  by functions in the
     module.  The granted module definitions are those	functions
     that  this	module provides	to the world, as opposed to local
     functions that are	not called outside this	module.

     For the "Find use of this type" question, you will	 need  to
     supply  a type definition in order	to find	all occurances of
     variables of this type. Only declarations of the form <type>
     <symbol> are supported by this query.

     For the "Find processes calling this function" question, you
     will  be  asked  for  a call tree depth. This is because the
     actions performed on this question	are to repeatedly  search
     for  the  calling	functions  until  the  call tree depth is
     exceeded or no more calling functions exist. Then	the  list
     of	top-most functions is matched against the process defini-
     tions to return a symbol reference	of each	definition.   The
     depth limits the search in	case of	infinite looping. You may
     find that increasing the call tree	depth will find	more pro-
     cess entry	points.

     For the "Find symbols in call tree	of this	 function"  ques-
     tion,  you	 will  be  asked for a call tree depth as for the
     processes question	above.	The actions performed are to find
     every called function, keeping intermediate functions, until
     the call tree depth is exceeded or	no more	called	functions
     can  be  found.  Then  the	 list  of all called functions is
     matched against the output	of the symbol search for the sym-
     bol  regular  expression.	This  in  fact	can be any symbol
     (function,	data item, message) only the  main  use	 of  this
     option was	intended to find where processes receive and send
     events (usually messages).	You can	use MG.* if you	 want  to
     find  all	messages  but beware of	the ammount of processing
     that this may take	in a large database!  Again, the function
     to	 start	from  can be any function, but was intended to be
     the process definition function entry point.

     For the "Find functions  called  by  this	function",  "Find
     functions	calling	 this function"	and "Find file #including
     this file"	queries, if closure mode is enabled, then a  call
     tree  depth  is  required.	 This is to control the	call tree
     searching for closure. This has the  effect  of  recursively
     applying  the  query  to the search results. For example, if
     you were asking for calling functions, then the use of  clo-
     sure mode returns repeated	calling	function results until no
     more can be found or the call tree	depth is exceeded.

     If	the search is successful, you can use these command char-
     acters:

     1-9    Edit the file containing the displayed line.
     space  Display next lines.
     +	    Display next lines.
     -	    Display previous lines.
     $	    Print lines	using trueprint. See sub-section below.
     >	    Write all lines to a file.
     >>	    Append all lines to	a file.
     <	    Read lines from a file.
     ^	    Filter all lines through a shell command.
     |	    Pipe all lines to a	shell command.

     At	any time you can use these command characters:

     ^P	    Move to the	previous input field.
     ^A	    Search again with the last pattern typed.
     ^B	    Recall previous input field	and search pattern.
     ^E	    Expand or  retract	the  file  path	 when  displaying
	    lines.
     ^F	    Recall next	input field and	search pattern.
     ^C	    Toggle ignore/use letter case when searching.
     ^R	    Toggle return required when	selecting lines.
     ^T	    Toggle truncating symbols to eight characters.
     ^U	    Update display options. Use	'c' for	closure	mode, 'e'
	    for	 setting  editor  to  $EDITOR,	'v'  for $VIEWER,
	    definitions	in this	module,	 Translate  mode  is  for
	    mapping  of	 .h  files  to .G or .L	files so that the
	    version editor will	work on	them. You  will	 need  to
	    drop back to the entry menu	if you select the version
	    editor as your main	editor to allow	Cdb to reset  the
	    environment, if needed.
     !	    Start an interactive shell	(type  ^D  to  return  to
	    Cdb).
     ^L	    Redraw the screen.
     ?	    Display this list of commands.
     ^D	^Z  Exit Cdb.

     Note: If the first	character of  the  pattern  you	 want  to
     search for	matches	one of the above commands, type	a \ char-
     acter first.

  Printing Lines using Trueprint.
     After typing the '$' command, you will be prompted	 for  any
     trueprint	options.  You select the lines to be printed with
     these command characters:

     1-9    Mark or unmark the line to be printed.
     *	    Mark or unmark all displayed lines to be printed.
     space  Display next lines.
     +	    Display next lines.
     -	    Display previous lines.
     a	    Mark or unmark all lines to	be printed.
     ^D	    Print the marked lines and exit.
     RETURN Exit without printing the marked lines.
     !	    Start an interactive shell (type ^D	to return to cdb.
     ^L	    Redraw the screen.
     ?	    Display this list of commands.

  Editors
     To	use an editor with Cdb it must accept the  syntax  '+nnn'
     where  nnn	 is  the  line number to begin editing with. Most
     editors have this syntax, but if you are using out	 of  date
     setup  for	 gmacs	this  can  be fixed by auto-executing do-
     plus-args on file starting	with "+*".

     There are versions	of vi, emacs and gnuemacs tag table calls
     to	 invoke	Cdb from within	the editor. If suppliers can pro-
     vide me with such tools, I	can make them available	to all.

     You can use the Version Editor (xvb/xve)  with  Cdb  without
     setting  up for a particular CMS instance,	just as	you don't
     need to do	this for other editors.	However	the Version  Edi-
     tor  (xvb/xve)  requires GENERIC,PREFIX,PROJECT and VPATH to
     be	set in order to	obtain ECMS information. This is automat-
     ically  provided by Cdb by	appending the VPATH that was used
     when  building  the  database.   In  addition,   since   the
     INCSTATUS	variable  conflicts  with  the line number option
     when calling up the editor, this is set  correctly	 by  Cdb.
     Similary,	the  WHOLE  variable is	set to "n" by Cdb. If you
     set these in your VEINIT file, you	may not	be at the correct
     line  number  due	to  unapproved	changes	or #feature lines
     being included in the version of the file	you  are  looking
     at.

  Special Keys
     If	your keyboard has arrow	keys that work in vi(1)	 you  can
     use  them to move around the input	fields.	 The up-arrow key
     is	useful to move to the previous	input  field  instead  of
     using  the	TAB key	repeatedly.  If	you have the CLEAR, NEXT,
     or	PREV keys they will act	as the	^L,  +,	 and  -	 commands
     respectively.

  Mouse
     If	you have  an  AT&T  5620/630/730  terminal  and	 use  the
     emacsterm(1), myx(1), or viterm(1)	terminal programs; or use
     the X Window System and the etermx(1) terminal  program;  or
     SunView  and the eterm(1) terminal	program; you can use your
     mouse with	Cdb. If	you use	the myx(1) terminal program,  set
     the MOUSE environment variable to myx (see	ENVIRONMENT VARI-
     ABLES).

     On	the entry menu,	point and click	button 1 to move  to  the
     desired  input  field.  Use  the  menu  on	button 2 to chose
     values for	 a  field  or  to  execute  the	 selection.  When
     prompted  with a list of values, point and	click button 1 to
     chose.

     On	the main menu, point with the mouse and	click button 1 to
     move  to the desired input	field, type the	pattern	to search
     for, and then press the RETURN key.  If the search	 is  suc-
     cessful,  you  can	edit the file containing a displayed line
     by	pointing with the mouse	and  clicking  button  1.   Press
     mouse button 2 to get a menu of commands.

  Options
     When invoking Cdb you will	normally not use any options. For
     compatibility  with  earlier  releases and	for building, you
     can also use these	options:

     -a	      Display all references when searching  for  defini-
	      tions  rather  than editing the first references if
	      all the references are in	the same file. If  -a  is
	      not  provided  then  the	editor	will  be  invoked
	      automatically. This option was added to cover func-
	      tions  with  ANSI	 C and non-ANSI	C function defin-
	      tions (e.g. with #ifdef __STDC__ around them).
     -A	      Audit the	databases. This	 runs  cdb  with  the  -x
	      option  and checks the return code. Can be run with
	      -P.
     -b	bld   Build the	database (db) or the Selector  Generation
	      File (sgf) or all	(all).
     -c	      Use closure mode when searching.
     -C	      Ignore letter case when searching.
     -d	      Do not update the	database built privately  before-
	      hand  by	providing  source  files as parameters to
	      Cdb.  Alternatively  this	 option	 will  utilise	a
	      private  database	built using Cscope beforehand and
	      left in the  file	 cscope.out.   This  option  will
	      start  Cscope  on	 your  private	database  in  the
	      current directory	as well	as on any official  data-
	      bases  selected.	 If  the  database  is not in the
	      current directory	then the viewpath is used to find
	      it.   The	database should	not have been built using
	      source files in the  viewpath,  as  this	conflicts
	      with  the	 ability  to  find  the	 database  in the
	      viewpath.
     -D	      Do  not  update  the   multiple	databases   built
	      privately	 beforehand  using Cscope and left in the
	      file <ss>/cscope.out.  This  option  must	 be  used
	      with  the	 -s option to select the multiple private
	      databases,  where	 each  "+"  separated	subsystem
	      replaces	<ss>.  If the database is not in the <ss>
	      directory	then the viewpath is  used  to	find  it.
	      The  database  should  not  have	been  built using
	      source files in the  viewpath,  as  this	conflicts
	      with  the	 ability  to  find  the	 database  in the
	      viewpath.
     -F	file  Read symbol reference lines from	file,  just  like
	      the < command.
     -G	      With the -L option, produce GL(1)	like output  from
	      line-orientated  queries	just  containing the file
	      names.
     -h	#     Give help	on error code #.
     -H	      Give full	help message.
     -i	      Set multiple invocation mode, using Cdb as the edi-
	      tor  and	providing  the	ability	to stack queries.
	      This option is used to parse call	 trees,	 allowing
	      you  to  follow  calls  to  or  from  functions, in
	      stacked cdb sessions.  Use the ^U	 command  in  the
	      display  to  turn	 off  this  mode to enable a line
	      number selection to edit the  file  as  opposed  to
	      executing	a recursive cdb	call.
     -I	file  Read source file	names  from  file  when	 building
	      private  databases.  This	is an alternative to pro-
	      viding the filenames as command line parameters.
     -k	 #    Keep a certain number of loads  when  administering
	      multiple loads. The default is 5.
     -l	      Use listings not text.
     -L	      Do a single search with line-oriented  output  when
	      used  with  the -n pattern option. In addition, the
	      selector may be set to "all", "allss" or "allprocs"
	      to perform multiple searches.  See Calling Cdb with
	      a	Line-Oriented Interface.
     -m	menu  Select the menu to be used in Cdb. The type of menu
	      can be:
	       r    Use	the reverse engineering	menu.
	       f    Use	the function (cscope) menu.
	       n    Do not use the entry menu (implies function	menu)
	       y    Use	the entry menu.
	       x    Do not use the entry menu (implies reverse menu - for xrefs)
     -M	make  Make the databases or re-build existings ones.  The
	      type of make can be:
	       +    Separator or dummy option to provide to -M.
	       a    Use	architecture selectors.
	       d    Use	shared DASD viewpaths (or NFS viewpaths	on NPSS).
	       f    Use	filesystem control for mounting/unmounting
	       g    Make global	interface xrefs.
	       l    Make local interface xrefs.
	       m    Use	machines selectors.
	       o    Use	operational kernel process selectors
	       p    Use	processor selectors. Use with 'o' if desired.
		    Use	with 'a' from 5ee6_1h/5e9_2m/atm1_1a onwards.
	       r    Build reverse engineering process files.
	       s    Setup databases from scratch.
		    Use	with -s	to build single	or multiple databases.
	       v    Use	viewpath, not setenv, to set the environment
	       x    Make module	xrefs.
     -n	node  Set default root node for	private	databases.
     -o	owner Set default owner	login for private databases.
     -O	old   Use path to an  old  version  of	Cscope	to  force
	      building with that version.
     -p	n     Display the last n file path components instead  of
	      the  default  (1).   Use	0 to not display the file
	      name at all.
     -P	project
	      Provide project.
     -q	      Build an inverted	index for quick	symbol seaching.
     -r	      Require pressing the RETURN key  after  typing  the
	      selection	digit(s) for a displayed line to edit the
	      file containing it, which	allows as many	lines  as
	      possible to be displayed.
     -R	      Remove the database before re-building in	order  to
	      create  space  for  the new database. Increases the
	      time to build at the expense of  preventing  failed
	      builds.	When  called  with  the	 -q  option,  the
	      inverted indexes are removed automatically and  re-
	      built with the -U	option on cscope.
     -s	selector
	      Provide the selector. This could	be  a  subsystem,
	      processor,  machine,  or architecture name. You can
	      use the special name "all" interactively if  built,
	      or  non-interactively,  meaning  all databases that
	      are  accessible.	The  special  names  "allss"  and
	      "allprocs"  are  provided	 to  limit the use of the
	      "all" selector to	only subsystem or processor data-
	      bases.  The  special  name  "re"	is  used to allow
	      builds of	eureka style OSDS process  databases  for
	      each  processor. You can provide lists of	selectors
	      by separating them with  "+".   To  query	 what  is
	      built, use "?" or	"??" for remote	queries.
     -S	      Show what	projects and loads are supported. Can  be
	      used with	-P.
     -t	      Use text not listings.
     -T	      Use  only	 the  first  eight  characters	to  match
	      against C	symbols.  A regular expression containing
	      special characters other than a  period  (.)   will
	      not  match  any  symbol  if  its	minimum	length is
	      greater than eight characters.
     -u	      Build only the most up-to-date load and do not  use
	      the  vpload  suffix  on  file  names.  Without this
	      option, 5	vploads	per database  can  be  supported,
	      see the -k option.

     -U	      Show  only  unique  references  to  simplify  query
	      results.
     -v	vpload
	      Provide the viewpath load. When provided	with  the
	      -x  option,  the	character  '?'	 is accepted as	a
	      query to provide the vpload and project for  remote
	      access.
     -x	      No execute mode for Cscope in order  to  initialise
	      and exit for auditing purposes.
     -X	xref  Provide an xref selector value to	 limit	subsystem
	      generation  file	building  to  just  that selector
	      value, package name, module or module product name.
     -z	      Line-oriented interface (see  Calling  Cdb  with	a
	      Line-Oriented  Interface).  In addition, the selec-
	      tor may only be set to "all"  if	the  database  is
	      built.
     -Z	file  Do a  repeated  search  with  line-oriented  output
	      using a file of queries.	In addition, the selector
	      may be set to "all", "allss" or "allprocs" to  per-
	      form  multiple  searches.	  See  Calling Cdb with	a
	      Line-Oriented Interface.
     -n	pattern
	      Go to input field	n (counting from 0) and	find pat-
	      tern.   For  the	reverse	 engineering menu, the -4
	      option requires the  format  patter:[s|r],  the  -7
	      option requires the format pattern:depth and the -8
	      option, the format pattern:depth:symbol.	If the -c
	      option is	provided then -2, -3 and -8 (on	the func-
	      tion menu) require the format  pattern:depth.   See
	      below for	common uses of most of these options.


EXAMPLES

  Calling Cdb from the Shell
     To	use Cdb	on all the 5ESS/ATM text or breakpoint	listings,
     just type

	  cdb

     If	you provide any	options, Cdb will  automatically  perform
     the  execute  entry menu command, to go directly to the main
     menu. For example,

	  cdb -s <selector>

     However for LSS, the entry	menu  is  not  used  and  the  -D
     option is needed to select	a database. For	example,

	  cdb -D -s <selector> [-f filename]

     You can select different projects using the PROJECT environ-
     ment variable or by typing:

	  cdb -s <selector> -P <project>

     This will also have the effect of setting the correct  owner
     for the load.

     For 5ESS/ATM, you can see what is built by	typing:

	  cdb -S

     For a more	detailed list of databases built for  a	 project,
     type:

	  cdb -s?

     for text databases	and

	  cdb -ls?

     for listings.

     To	perform	a symbol search	all (text or listings)	databases
     non-interactively,	type

	  cdb -L -s all	-0 symbol

     You can use cdb on	particular files to build a private data-
     base used as well as an official database.	 Just provide the
     source files on the command line:

	  cdb -s <selector> <source files>

     If	you already have a  database  built,  either  by  cdb  or
     cscope  and it exists either in the current directory, or in
     the viewpath, as file cscope.out, you can access it as  well
     as	an official database as	follows:

	  cdb -d -s <selector>

     If	you have a file	of source file names, you can use the  -I
     option to build these files into a	private	database:

	  cdb -s <selector> -I <file>

  Boolean Searching
     You can do	the equivalent of Boolean or logical AND, OR, and
     NOT  operations  on  searches  with the ^,	>, >>, and < com-
     mands.  For example, if you wanted	 all  references  to  the
     symbol  stderr  in	 file invlib.c,	search for the symbol and
     then use the ^ command with shell command

	  grep invlib.c

     If	you wanted all the references not in this file,	 use  the
     grep(1)  -v  option.  If you wanted all the lines where sym-
     bols stderr or stdout are used, search for	the first symbol,
     write  the	 references  to	a file with the	> command, search
     for the second symbol, append the	references  to	the  same
     file  with	the >> command,	read the file with the < command,
     and get rid of duplicate lines with the ^ command using  the
     shell command

	  sort | uniq

     Note that all <global> references will no	longer	be  first
     because the references will be sorted by file name.

  Calling Cdb with a Line-Oriented Interface
     The -L, -zd -Z options let	 you  use  Cdb	where  a  screen-
     oriented  interface  would	 not be	useful,	e.g. from another
     screen-oriented program.  Cdb will	prompt with ">>	" when it
     is	 ready	for  an	input line starting with the field number
     (counting from 0) immediately followed by	the  search  pat-
     tern,  e.g.  "1main"  finds the definition	of the main func-
     tion.  Field number 7 requires  the  format  pattern:depth".
     Field  number  8  requires	 the format pattern:depth:symbol.
     Field number 9 followed by	a grep pattern,	e.g. "9.*", finds
     all  function and C++ class definitions.  If you just want	a
     single search, instead of the -z option use the  -L  and  -n
     pattern  options (where n is 0-9),	and you	won't get the ">>
     " prompt.	For repeated searches, instead of the  -z  option
     use  the  -Z option to provide a file of queries. The format
     of	the input file is the same as you would	provide	 for  the
     -z	option.	 For multiple searches,	Cdb outputs the	number of
     reference lines

	  cdb: 2 lines

     For each reference	found, Cdb puts	a line consisting of  the
     file  name,  function  name,  line	 number,  and  line text,
     separated by spaces, e.g.

	  main.c main 161 main(argc, argv)

     Note that the editor is  not  called  to  display	a  single
     reference,	unlike the screen-oriented interface.  The -L and
     -Z	options	allow you to perform multiple  database	 searches
     using selectors "all", "allss" and	"allprocs". The	-G option
     restricts the output to just filenames.

     Cdb provides other	queries:
     c	      Toggle case sensitive seraching
     C	      Toggle closure mode
     P	      Print database paths
     d text|listings
	      Set database type	for queries
     f root   Query filesystems	pointed	to from	this  root  node.
	      i	root/directory Query indexed selector database in
	      this directory.
     l root/SGF-directory
	      Query loads supported in this root node.
     n directory
	      Query default node for this directory.
     o login  Query owner directory for	this login.
     p directory
	      Query projects  supported	 in  this  directory.	s
	      root/SGF-directory/*[load]*  Query  selectors  sup-
	      ported in	this root node (the load can be	omitted).
     q ^D     Cdb will quit when it detects end-of-file	or one of
	      these characters.

  CURRENT BUILDING PROCEDURES
     General points:

     Cdb is built for both TEXT	and LISTINGS after the new build.

     Cdb is built for TEXT only	when the load is moved to the APP node.

     Required Environment:
	  $HOME/.defproj = path	to X for default text project
	  $HOME/.deflist = path	to X for default listings project

	  where	X is either a file listing the remote cdb support or
	  a project directory under $HOME or on	another	filesystem if the
	  home filesystem does not have	enough space.

	  If these are not provided, error code	7 will be given	when auditing
	  each database.

	  For remote CDB, these	files must be set to indicate the remote
	  server machine in the	format:

	       ri-cdb <machine-name>

	  For remote CDB, these	files may point	to a file which	lists
	  the remote CDB support by project e.g. X = $HOME/.ricdb-npss
	  where	the format of the file is:
	       <project>^I<path	or ricdb server>
	  The use of '*' indicates the default project.

	  For remote CDB the following does not	apply.

	  P can	be under $HOME or $HOME/directory or on	a new filesystem
	  but every project supported must have	a project directory at the
	  same directory level as project P for	user project swapping. Thus
	  the path to Q	is made	by taking the path to P, taking	off the	last
	  directory and	substituting the new project's directory.
	  $HOME/P/.project = full path to X for	text databases
		       or full path to file of databases and filesystems
		       or relative path	to P if	databases under	this node
	  $HOME/P/.listings = full path	to X for listings databases
		       or full path to file of databases and filesystems
		       or relative path	to P if	databases under	this node

	  X can	be on the same filesystem or on	a new (shared) filesystem
	  to provide space for the databases (e.g. a quad or triple filesystem)
	  i.e. X = /OSXXX/OWNER/P where	P is the project directory.

	  X can	also be	a full pathname	to a file, which provides
	  multiple filesystem pointers,	e.g. X = $HOME/P/multiplefs
	  where	the format of the file is:
	       <selector>^I<filesystem>

	  /OSXXX/OWNER/X/.default = default text vpload	name
	  /OSXXX/OWNER/X/.load = default text load name
	  /OSXXX/OWNER/X/.listload = default listings load name
	  /OSXXX/OWNER/X/.issue	= issue	name if	not same as project
	  /OSXXX/OWNER/X/.alpha	= project load letter if not in	project

	  /OSXXX/OWNER/X/structure/* = list of text source files
	  /OSXXX/OWNER/X/listings/* = list of listings source files

	  /OSXXX/OWNER/X/*/cdb = text database
	  /OSXXX/OWNER/X/*/ldb = listings database

	  Audits should	be run under cron using	the cdb	-A command.
	  Help on error	codes is available using cdb -h	#.


     Queue the build job, using	 TMPDIR	 to  provide  circa  100K
     blocks  of	 free space for	the build (if /usr/tmp is not big
     enough):

	  cd $ROOT/logs

     For listings in separate filesystems:
	  lgqueue mail=no out=xx.log.L <<-!
	  TMPDIR=/XXXX/cscope ulim -350000 cdb -M f -b all -l -qR -v <load>
	  !

     For listings in the same filesystems as the text:
	  lgqueue mail=no out=xx.log.L <<-!
	  TMPDIR=/XXXX/cscope ulim -350000 cdb -M fv -b	all -l -qR -v <load>

     The -M v option can be used to avoid re-running the "setenv"
     script  in	 all  text builds and prevents viewpath	modifica-
     tions by the "setenv" script causing  files  to  be  omitted
     (e.g.  the	 QFX  node  for	 US).	For  5ee5_2f/5e7_1j  text
     onwards, use the -M d option to get  access  to  the  shared
     load  filesystems	viewpath.  Use	the -M f option	to shared
     DASD    filesystem	   control    (sumount/smount).	     From
     5ee6_2o/5e9_2m  onwards,  use  the	 -M r option to	build the
     reverse engineering process files.	 To keep  multiple  data-
     bases  do	not supply the -u option. You can keep a specific
     number by using the -k option e.g.	-k 2.

	  lgqueue mail=no out=xx.log <<-!
	  TMPDIR=/XXXX/cscope ulim -350000 cdb -M dfrv -b all -t -qR -v	<load>
	  !

     If	a selection file of pointers to	multiple  filesystems  is
     being  used,  be aware that only databases	in this	file will
     be	built. A default vpload	file, the .default file, will  be
     created  in  the default root node	to provide the vpload for
     -s? queries. This must be shipped along with  the	selection
     files

	  ship.file cdbpaths <project>
	  ship.file ldbpaths <project>
	  ship.file .default <project>

     For re-building after errors use the -M s option with the -s
     <selector>	 option	to restrict the	build to one selector. To
     build the reverse engineering  process  files  specifically,
     use  selector  "re"  i.e.	-s  re.	 Use the -M df option for
     shared DASD builds	as above.

	  lgqueue mail=no out=xx.log <<-!
	  cdb -M sv -b all -s <selector> -qR -v	<load>
	  !


ENVIRONMENT VARIABLES

     AIDMODE	  Set to "novice" to get introductory help on the
		  entry	menu or	"expert" to avoid getting this.
     CDBDEPTH	  Cdb depth.
     CDBOPTS	  Cdb options.
     CDBOWNER	  Cdb owner login.
     CSCOPEDB	  Set by Cdb  for  subshells,  to  point  to  the
		  cscope   databases.	Multiple   databases  are
		  separated by commas.
     CSCOPEOPTIONS
		  Cscope options.
     EDITOR	  Your editor, which defaults to vi(1).
     HOME	  Your home directory, which is	automatically set
		  when you login.
     GENERIC	  Version Editor Generic.
     INCSTATUS	  Version Editor Include Status.
     ISSUE	  The 5ESS/ATM/LSS Issue.
     MOUSE	  Set to myx if	that is	your 5620  terminal  pro-
		  gram.
     MOUSEMENU	  Set to none if you do	not want cdb to	switch to

		  its mouse menu so you	can have your own custom-
		  ized Cdb submenu on the shell	menu.
     PAGER	  The pager you	prefer to use, default pg(1).
     PREFIX	  The ECMS prefix file.
     PROJECT	  Version Editor Project.
     ROOT	  The path to the node where databases are to  be
		  built.
     RSHLOGIN	  The value to use with	the -l option of rsh.
     RXPORT	  Export  list	of  environment	  variables   for
		  Rexec(1).
     SAVEROOT	  Saved	root node (when	you want cdb  to  add  in
		  optional nodes when creating its own VPATH)
     SAVEVPATH	  Saved	viewpath (when you don't want cdb to work
		  out its own VPATH).
     SAVEVPTYPE	  Saved	viewpath type (when you	want cdb  to  use
		  this	vptype in addition to what it defaults to
		  - e.g. exenv).
     SETENV	  The 5ESS/ATM/LSS setenv script name.
     SS		  The 5ESS/ATM/LSS subsystem name.
     SHELL	  Your shell, which defaults to	sh(1).
     TERM	  Your terminal	type, which must be a screen ter-
		  minal.
     TERMINFO	  Terminal information directory full path  name.
		  If  your  terminal  is not in	the standard ter-
		  minfo	directory, see curses(3X) and terminfo(4)
		  for how to make your own terminal description.
     TMPDIR	  Temporary file  directory,  which  defaults  to
		  /usr/tmp.
     TRUEPROPTS	  For Trueprint(1).
     VIEWER	  Your file display program, which overrides EDI-
		  TOR (see above).
     VPATH	  The ECMS viewpath.
     VPLOAD	  The 5ESS/ATM/LSS viewpath load name.
     VPTYPE	  The 5ESS/ATM/LSS viewpath type.
     WHOLE	  Version Editor Whole.

     To	set a variable such as EDITOR to a value such  as  emacs,
     put this in your .profile:

	  export EDITOR
	  EDITOR=emacs


FILES

     All relative files	are found in the owners	login (cscope  by
     default for international and lbteam for US).
     (DIR)/{LOAD}{SELECTOR}
		   Selector Generation File containing	the  list
		   of source files for text and	listings.
     {SELECTOR}/(DB).{VPLOAD}
		   Default symbol database  file  (overridden  by
		   the -u option).
     ".motd"	   Message of the day.
     ".news"	   Latest news.
     rje/.cdb.usage
		   Statistics logs file.
     /usr/5ess/data/(PROJECT)/vpath_table
		   Viewpath load to load mapping for 5ESS.
     /X/atmbld/data/(PROJECT)/vpath_table
		   Viewpath load to load mapping for ATM.
     /usr/umts/data/(PROJECT)/vpath_table
		   Viewpath load to load mapping for LSS.
     cscope.out	   Private cscope database.


SEE ALSO

     Cscope(Exptools),	 Emacsterm(Exptools),	Eureka(Exptools),
     Grep(1),	    Rcmd/Rsh(1),       Regcmp(3X),	Rexec(1),
     Trueprint(Exptools), Ve(Exptools)


BUGS

     Since Cdb passes all command line options	to  subshells  in
     the environmental variable	CDBOPTS, conflict can arise, e.g.
     if	-l is used on the first	call, then listings will be  used
     on	 the  second! This feature is vital to making some of the
     options that call Cdb as the editor work (since they  cannot
     be	specified on the command line).	 Also this feature can be
     used to advantage.	To disable, unset  CDBOPTS  in	the  sub-
     shell, or use -t to counter the -l	option.

     Cdb calls cscope with the -f option for  private  databases.
     This  will	mean that to use an existing private database not
     built by cdb you must call	cscope with "-f	 cscope.out"  due
     to	 cscope's  peculiar  handling  of  the default file names
     "cscope.in.out" and "cscope.po.out". The -f option	 produces
     "cscope.out.in" and "cscope.out.po"!


AUTHOR

     Mark T. Skeates
     Joe Steffen, for providing	the Cscope source.

















Man(1) output converted with man2html