home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / adav313.zip / gnat-3_13p-docs.zip / gdbtk.INF (.txt) < prev    next >
OS/2 Help File  |  2001-09-16  |  15KB  |  343 lines

  1.  
  2. ΓòÉΓòÉΓòÉ 1. Title page ΓòÉΓòÉΓòÉ
  3.  
  4.                         Using the Graphical Interface to
  5.  
  6.                           The GNU Source-Level Debugger
  7.  
  8.                                        ()
  9.  
  10.                           Edition 4.13.3, for  version
  11.  
  12.                                      May 19
  13.  
  14.                                  by Albert K. Lee
  15.  
  16.                       based on original by Stanley T. Shebs
  17.  
  18. Copyright (C) 1994, 1995, 1998, 1999 Free Software Foundation, Inc. 
  19.  
  20. Permission is granted to make and distribute verbatim copies of this manual 
  21. provided the copyright notice and this permission notice are preserved on all 
  22. copies. 
  23.  
  24. Permission is granted to copy and distribute modified versions of this manual 
  25. under the conditions for verbatim copying, provided also that the entire 
  26. resulting derived work is distributed under the terms of a permission notice 
  27. identical to this one. 
  28.  
  29. Permission is granted to copy and distribute translations of this manual into 
  30. another language, under the above conditions for modified versions. 
  31.  
  32.  
  33. ΓòÉΓòÉΓòÉ 2. Top node: "Using GDBTk, the Graphical Interface to " ΓòÉΓòÉΓòÉ
  34.  
  35.  
  36. ΓòÉΓòÉΓòÉ 3. Starting GDBTk ΓòÉΓòÉΓòÉ
  37.  
  38. GDBTk will, by default, run using its graphical interface.  When running on a 
  39. UNIX system, the following requirements must be met, or else the debugger will 
  40. revert to a command line interface: 
  41.  
  42.      Your terminal must be running an X server. 
  43.  
  44.      The DISPLAY environment variable must be set correctly. 
  45.  
  46.      The -nw (``no-window'') option was not specified on the GDBTk command 
  47.       line. 
  48.  
  49.  The Windows NT/95/98 version of GDBTk will default to a graphical interface. 
  50.  To force the debugger to run in command line mode, invoke it with the -nw 
  51.  option. 
  52.  
  53.  
  54. ΓòÉΓòÉΓòÉ 4. Getting Acquainted ΓòÉΓòÉΓòÉ
  55.  
  56.  
  57. ΓòÉΓòÉΓòÉ 4.1. Menus ΓòÉΓòÉΓòÉ
  58.  
  59. All of the main GDBTk windows have in common a File menu, an Options menu, and 
  60. a Window menu.  Of these, the File and Window menus will always contain the 
  61. same entries. 
  62.  
  63.  
  64. ΓòÉΓòÉΓòÉ 4.1.1. File Menu ΓòÉΓòÉΓòÉ
  65.  
  66. The standard file menu provides operations that affect the overall state of 
  67. GDB. 
  68.  
  69.      File:  Lets you set the combined executable and symbol file that GDB will 
  70.       use.  (Like the  command `file'.) 
  71.  
  72.      Target:  Brings up a dialog that you can use to connect GDB to a target 
  73.       program.  The dialog is described in more depth later.  (Like `target'.) 
  74.  
  75.      Edit:  Starts up an editor to modify the source file being displayed. 
  76.  
  77.      Exec File:  Lets you set the executable file that GDB will use.  (Like 
  78.       `exec-file'.) 
  79.  
  80.      Symbol File:  Lets you set the symbol file that GDB will use.  (Like 
  81.       `symbol-file'.) 
  82.  
  83.      Add Symbol File:  Lets you add additional symbol files.  (Like 
  84.       `add-symbol-file'.) 
  85.  
  86.      Core File:  Lets you set the core file that GDB will use.  (Like 
  87.       `core-file'.) 
  88.  
  89.      Close:  Closes the current window. 
  90.  
  91.      Quit:  quits GDB.  (Like `quit'.) 
  92.  
  93.  
  94. ΓòÉΓòÉΓòÉ 4.1.2. Windows Menu ΓòÉΓòÉΓòÉ
  95.  
  96. The windows menu allows access to all the windows available in GDB.  If the 
  97. window exists already, selecting the item will cause the window to be put in 
  98. front.  If it does not exist, then it will be created. 
  99.  
  100.  
  101. ΓòÉΓòÉΓòÉ 4.1.3. Options Menu ΓòÉΓòÉΓòÉ
  102.  
  103. All the primary windows have an Options menu, but each menu's contents are 
  104. highly specific to its window's type.  For instance, a source window will have 
  105. an options menu item to control the display of line numbers, but a register 
  106. window will instead have an option to choose the radix in which to display 
  107. register contents.  You can find the full descriptions of available options 
  108. with the description of each GDBTk window below. 
  109.  
  110.  
  111. ΓòÉΓòÉΓòÉ 4.2. Windows ΓòÉΓòÉΓòÉ
  112.  
  113.  
  114. ΓòÉΓòÉΓòÉ 4.2.1. Command Window ΓòÉΓòÉΓòÉ
  115.  
  116. The command window provides access to the standard GDB command interpreter.  In 
  117. nearly all cases, commands typed into this window will behave exactly the same 
  118. as a non-windowing GDB. 
  119.  
  120. Note that not all changes to GDB will be reflected in this window.  For 
  121. instance, if you were to type a step command, then click on the `step' menu 
  122. item in the source window, then go back to the command window to type another 
  123. step command, the command buffer will only show two steps, when you have 
  124. actually done three. 
  125.  
  126.  
  127. ΓòÉΓòÉΓòÉ 4.2.2. Source Window ΓòÉΓòÉΓòÉ
  128.  
  129. The source window displays a single file of source code.  The display updates 
  130. itself automatically whenever GDB's current internal source location pointer 
  131. changes. 
  132.  
  133. The color of the line numbers along the left side of the source display is 
  134. indicative of whether a breakpoint may be set at a line.  Line numbers that are 
  135. highlighted in green are those on which breakpoints may be set.  Clicking the 
  136. left mouse button within the green area will place a breakpoint on the line, 
  137. while turning the entire line red to indicate the breakpoint's existence. 
  138. Clicking the line number again will unset the breakpoint. 
  139.  
  140. To create a special breakpoint (for instance, one that breaks only in a 
  141. specific task, or a temporary or hardware breakpoint), or to create multiple 
  142. breakpoints on the same line, hold down the right mouse button while the mouse 
  143. cursor is over the line at which you wish to set the breakpoint.  A pop-up menu 
  144. should appear; choose ``set breakpoint,'' which will cause a breakpoint 
  145. creation dialog to appear.  If multiple breakpoints exist on a line and the 
  146. corresponding line number is clicked to remove a breakpoint, a dialog will 
  147. appear that allows the user to choose which breakpoints to delete. 
  148.  
  149. Launching an editor on the file is accomplished by holding down the right mouse 
  150. button with the mouse cursor in the source display.  Choose the ``Invoke 
  151. Editor'' option off the pop-up menu.  If the EDITOR environment variable is 
  152. set, then that editor will be started; otherwise GDBTk will default to starting 
  153. emacs. 
  154.  
  155. Along the bottom of the window are debugger control buttons, which mostly 
  156. correspond to gdb commands of the same name. 
  157.  
  158.      Run -- Causes the debugee to execute from the beginning. 
  159.  
  160.      Start -- Sets a temporary breakpoint on the Ada main procedure,     then 
  161.       runs the program from the beginning.  This is the same as the     `begin' 
  162.       command. 
  163.  
  164.      Next -- Single step, step over subprogram calls. 
  165.  
  166.      Step -- Single step, step into subprogram calls. 
  167.  
  168.      Cont -- Continue normal execution. 
  169.  
  170.      Finish -- Break on exit of current stack frame. 
  171.  
  172.      Up -- Traverse one step to the caller's stack frame. 
  173.  
  174.      Down -- Traverse one step to the callee's stack frame. 
  175.  
  176.      Bottom -- Return to frame 0. 
  177.  
  178.      Stop -- Send a SIGINT to the debugging engine. 
  179.  
  180.  While the source window is active, keyboard shortcuts for Next, Step, Cont, 
  181.  Finish, Up, Down, and Bottom are available---simply hit the first letter of 
  182.  the command you wish to execute, to invoke that command. 
  183.  
  184.  The display of line numbers along the left margin of the source display can be 
  185.  toggled on or off via the `Line Numbers' entry under the `Options' menu.  It 
  186.  is also possible to search a displayed source file for a string of text using 
  187.  the `Search for Text' facility, also under the `Options' menu. 
  188.  
  189.  It is possible to load and temporarily display a source file other than that 
  190.  pointed to by GDBTk's current source pointer.  Under the `Options' menu, 
  191.  select the `Select Source File' item.  A `File Selection' dialog should 
  192.  appear.  The search for a source file may be restricted in a number of ways. 
  193.  
  194.  By default, all source files used to create the executable are shown in the 
  195.  two file lists.  The contents of the first list change based on the `Include 
  196.  runtime library' toggle, which specifies whether we take the GNAT runtime 
  197.  library into consideration, and on the `Directory' setting.  Note that the 
  198.  directories shown in the `Directory' pop-up list do not necessarily match that 
  199.  of the current directory hierarchy; the listed directories are simply those 
  200.  that were compiled into the executable as debugging information. 
  201.  
  202.  The contents of the second file list in the `File Selection' dialog are a 
  203.  subset of the first list, and is modulated by two entry boxes located below 
  204.  the file lists.  To restrict the number of files in the `Pruned List', enter a 
  205.  UNIX-style wildcard expression; only those files matching this expression will 
  206.  be displayed.  Or, use the `Search for Subprogram' entry to search all source 
  207.  files for a specific subprogram. 
  208.  
  209.  When you have found the file you would like to display, either click on the 
  210.  filename (either in the first or second list) then click `Ok', or double-click 
  211.  on the filename.  If GDBTk has trouble displaying a given source file, the 
  212.  command-line directory command can be used to add to (or clear) GDBTk's source 
  213.  file search path.  Each entry in this search path is prepended to the filename 
  214.  being searched for, in an attempt to find the actual location of that file. 
  215.  
  216.  
  217. ΓòÉΓòÉΓòÉ 4.2.3. Stacks Window ΓòÉΓòÉΓòÉ
  218.  
  219. The Call Stack Window shows a backtrace of the currently running program. 
  220. Clicking on any item in the list will select its stack frame as the current 
  221. one.  The source display will update to show the source line associated with 
  222. the currently selected frame.  This does not affect the context under which the 
  223. step or next commands operate, but does affect the finish command. 
  224.  
  225.  
  226. ΓòÉΓòÉΓòÉ 4.2.4. Register Window ΓòÉΓòÉΓòÉ
  227.  
  228. The contents of this window are similar to the output from info registers.  The 
  229. entries in the Options menu allow the user to specify the radix that the data 
  230. is displayed in, and, via the `Config' item, to select which registers are 
  231. displayed.  Registers that have changed since the last evaluation of the 
  232. register contents are highlighted in red. 
  233.  
  234.  
  235. ΓòÉΓòÉΓòÉ 4.2.5. Expressions Window ΓòÉΓòÉΓòÉ
  236.  
  237. This is a variable display window with a slight resemblance to that provided by 
  238. the Data Display Debugger (DDD).  This window may be activated either by 
  239. double-clicking on a highlighted phrase in the source window (which will import 
  240. that phrase as a new expression), or by calling it up via the Window menu. 
  241.  
  242. There are two buttons along the bottom of the window called `New Expression' 
  243. and `Refresh'.  Pressing `New Expression' allows the user to manually enter an 
  244. expression to be displayed. `Refresh' will refresh all variables that are on 
  245. the canvas, regardless of how `Auto Update' is toggled for each expression. 
  246.  
  247. Holding the right mouse button down on the title bar of any data table will 
  248. cause a menu with extra functions will appear, with the following options: 
  249.  
  250.      Auto Update -- Toggle whether the display follows the current     value 
  251.       of this variable. 
  252.  
  253.      Dereference -- Create a new expression based on a     dereferencing of 
  254.       the expression. 
  255.  
  256.      Memory Display -- Examine this variable using the Memory     Display 
  257.       window. 
  258.  
  259.      Delete Expression -- Discard this table. 
  260.  
  261.  Similarly, holding the right button down on an entry within the table (if the 
  262.  expression was, for instance, a record type) will pop up another menu, this 
  263.  time with the options: 
  264.  
  265.      New Expression -- Create a new table using this item as the 
  266.       expression. 
  267.  
  268.      Set Value -- change the value of this item 
  269.  
  270.  It is possible to rearrange the tables by using the first mouse button on the 
  271.  titlebars to drag the tables around the canvas.  Application of coarsely 
  272.  gridded anchoring can be toggled via the Options menu. 
  273.  
  274.  
  275. ΓòÉΓòÉΓòÉ 4.2.6. Auto Command Window ΓòÉΓòÉΓòÉ
  276.  
  277. Every time GDBTk returns from executing debugee code (such as after a Next 
  278. command, or when a breakpoint is hit), if the Auto Command window is active, 
  279. the command entered into it will execute once with the results of that command 
  280. displayed in the data area of the window. 
  281.  
  282.  
  283. ΓòÉΓòÉΓòÉ 4.2.7. Breakpoints Window ΓòÉΓòÉΓòÉ
  284.  
  285. The Breakpoints Database Window allows you to manipulate any breakpoints that 
  286. are set in the debuggee.  The display area on the left side of the window 
  287. contains information about a specific breakpoint.  This information includes 
  288. the following: 
  289.  
  290.      GDB's internal breakpoint ID number 
  291.  
  292.      The breakpoint's location (file/line pair) 
  293.  
  294.      The breakpoint's address 
  295.  
  296.      Whether the breakpoint is currently enabled or disabled 
  297.  
  298.      What to do when the breakpoint is hit 
  299.  
  300.      The number of times the breakpoint has been hit 
  301.  
  302.      The number of times the breakpoint should be ignored 
  303.  
  304.      The conditions under which this breakpoint will actually break 
  305.  
  306.      Whether this breakpoint is active only while in a specific task/thread 
  307.  
  308.      Any commands that are to be executed when the breakpoint is hit 
  309.  
  310.  The right side of the window contains a button row with an associated 
  311.  scrollbar which may be used to choose a breakpoint from whatever is available. 
  312.  Below that, four buttons labelled "Create", "Modify", "Delete", and "Close" 
  313.  are available. 
  314.  
  315.  Pressing the Create button will bring up a breakpoint creation dialog where 
  316.  you may specify parameters for creating a new breakpoint.  Modify allows you 
  317.  to modify certain properties of the currently displayed breakpoint.  Delete 
  318.  will delete the currently displayed breakpoint, and Close will close the 
  319.  Breakpoint window. 
  320.  
  321.  
  322. ΓòÉΓòÉΓòÉ 4.2.8. Tasking Window ΓòÉΓòÉΓòÉ
  323.  
  324. Information regarding currently active Ada tasks can be found in this window. 
  325.  
  326. Displayed information includes an indication of which task is active, the GDB 
  327. task number, the task number of the task's parent, its priority, its name, and 
  328. its current state.  On supported platforms, clicking on a line in this window 
  329. will switch the debugger's context (source display, call stack, etc.) to that 
  330. line's associated task. 
  331.  
  332. Automatic update of the contents of this window may be toggled via the Options 
  333. menu, and is off by default.  The Update button is present only when autoupdate 
  334. is not active. 
  335.  
  336.  
  337. ΓòÉΓòÉΓòÉ 4.2.9. Memory Window ΓòÉΓòÉΓòÉ
  338.  
  339. A 512-byte section of memory can be displayed in octal, decimal, hexadecimal, 
  340. or character representations through this window.  To choose an adjacent 
  341. 512-byte block of memory, press the Next and Prev buttons.  To enter a new 
  342. address to observe, press the New button, or use the facility provided by data 
  343. tables displayed in the Expressions window.