v2.0
of the Windows Debugger |
SN Systems Ltd |
Date: 21/2/97 |
tel://+44 117 9299733 |
Welcome to patch level 6. This version introduces a number of bug fixes over 10_5. Most importantly, check out Changes which details the changes between patch levels. Changes introduced in 10_5 are tagged with <New in 10_5>.
The documentation shipped with this release reflects a previous version of the debugger (v1.6). Full revised documentation for v2.0 is available and will be shipped shortly.
Make sure you don't miss out on updates; SN Systems host a number of mailing lists for sending out important information. Either check out the web page and look for 'support', or mailto:john@snsys.com.
Debugger Heap Management <New in 10_5>.
Things you can Change <New in 10_5>.
Changes (version and release changes and fixes)
This release of the debugger uses two Microsoft system DLLs that have become part of Windows 95 operating system, but were not shipped with the original version of the OS in August 1995. The DLLs in question are COMCAT.DLL (implementing COM categories) and an enhanced version of COMCTL32.DLL (implementing Windows common controls). Install will attempt to install COMCAT.DLL and register it if is not already present.
These DLLs will already be present on any system that has previously been installed with any of the following pieces of software:-
Windows 95 ORP 2 (this is OEM Release Pack 2 - it is only available on some machines pre-installed with Windows 95 or on CD as part of the MSDN)
MS Internet Explorer 3.0 (this is available free of charge from Microsoft)
Office '97 and many of the products release by MS in 1996
COMCTL32.DLL is not re-distributable and so we are not allowed to ship it with this install. If COMCTL32.DLL is not present on your system then PSY_WIN.EXE will not load and instead complain that there is an undefined dynalink in COMCTL32.DLL. To remedy this problem, you can obtain COMCTL32.DLL from Microsoft. Download and install the latest released version of Microsoft Internet Explorer. If you don't want Internet Explorer, you can then uninstall it.
This note only applies if you have installed previous versions of the debugger on your machine, or want to share project files with other users of the debugger.
v2.0 saves project files in a slightly different format from v1.x. This new format is not compatible with older versions of the debugger (1.x), i.e. v2.0 can read v2.0 and v1.x project files but can only save v2.0 files. v1.x can only read and save v1.x files. v1.x may crash on attempting to load a v2.0 file. If you share project files with other uses of the debugger or think you may need to revert to a previous version of the debugger, then bear this in mind by saving copies of your project files before you let v2.0 convert them.
v2.0 will ignore any breakpoints you had set in a v1.x project.
Online help has not yet been completed. The help shipped with this release is that from v1.6 and doesn't cover any of the new features. This document is currently the only resource available for help.
The Disassemble Memory dialogue is used to produce a machine code disassembly of a specified area of memory, much like you see in a Debugger's Disassembly pane. The area to be disassembled can be specified as an address range, as a number of bytes, or as a number of instructions. The output can be copied to a file on your PC, or it can be send to the Windows Clipboard to be pasted directly into another Windows program.
Specifies what to do with the output of the disassembly. For output to a file the name and path can be explicitly specified, or chosen by Browsing. To save to the Windows Clipboard, check the 'Save to Clipboard' box.
Address on the targets memory from where to start disassembly. This value is always in Hexadecimal. Clicking on the button by the start address edit box will bring up the Expression Manager. This allows an expression to be used to calculate the start address.
The value specified in 'Stop Value' will depend on the stop method chosen by selecting an option from the 'Stop With' list. If an Address is to be used, then the value given must be a Hexadecimal address like the start address. If the value is to be a length of a number of bytes or instructions then it must be specified in Decimal only.
When specifying the stop value as an address, the Expression Manager is available via the button.
v1.5+ of the debugger already exposes the Psy-CO library for direct access to the target. v2.0 introduces an enhanced API designed to allow 'plug-in' components to access high-level debugging information and events. Some components shipped with v2.0 are plug-ins and can be installed separately. See the plug-in manager for more information.
Programming documentation for the API is not yet complete and is therefore not included in this release.
Overview
The Breakpoint Manager Pane and Dialog allow you to view all current breakpoints. It also allows you to set breakpoints anywhere in memory and alter the breakpoint's type and settings.
There are now four types of Breakpoint:
Absolute - PC stops when it arrives at the breakpoint.
Counter - Increases its counter by one every time the PC passes the breakpoint. Does not stop the PC.
Countdown - Decreases it's counter from an initial user-set value every time the PC passes the breakpoint. When the counter reaches zero the PC stops at the breakpoint.
Conditional - PC stops at a conditional breakpoint only if a user-specified expression evaluates as TRUE.
Breakpoint Manager Pane
The Breakpoint Manager Pane consists of a List View control which displays the Address, Type, Counter and Enabled status of each breakpoint currently set. You can add or remove breakpoints, alter breakpoint properties or disable breakpoints by right-clicking on the list and selecting from a menu.
The Breakpoint's type is also reflected in the icon displayed next to its address. This icon changes to a 'Triggered' icon when the breakpoint stops the PC.
Breakpoint Manager Dialog
The Breakpoint Manager Dialog, accessible from the Debugger's tools menu performs identical functions to the pane but uses buttons as well as the right-click menu. This can be used to quickly change breakpoint settings without switching pane types.
Breakpoint Property Dialog
When you select Breakpoint Properties from either the Breakpoint Pane or Dialog or Edit Breakpoint from the Source or Disassembly pane, a small dialog appears which shows settings for the currently highlighted breakpoint. Use this to alter breakpoint type and counter or disable the breakpoint.
The call stack display shows the stack and function parameters. To show the call stack, choose 'Other' as the new pane type, left click on the blank pane and choose Call Stack from the dialog.
NB: The debugger will only provide call stack information when it detects there is a valid frame pointer and there are symbols available for the current function.
Overview
The Call Stack Display plug-in allows the user to view the whole of the stack and to step up and down the stack to a particular context.
The benefit of such a tool is that it is possible to see the functions being called and where they were called from. It is also possible to see the parameter types and values that were being passed to a function.
User interaction
When the call stack display dialog appears, the user will be presented with a view of the whole stack, with an icon ( a green triangle ) pointing to the current context. Other contexts are shown with a red triangle next to them. Parameter details are shown with a red or green circle beside them depending on whether they are a part of the current context or not.
Use of the Windows 95 tree control
It has been decided to use the tree control to show information about the stack. The reason for this is that it should be easy to see at a glance which context the stack is in and which function calls have been placed on the stack. Should the user wish to view more information about a function call, the branch can be expanded. The idea is that depending on whether the user wishes to view function return values, parameter types or parameter values, branches will be shown for those items if available.
Using the scroll bar
A scroll bar on the right of the tree control allows the user to view various portions of the stack. When the user clicks on a stack context, the pointer will move to that context and reposition the view on the stack accordingly.
Switching contexts
The context (machine state) can be altered to reflect a previous function call by double clicking on a particular context in the tree control. The green icon will be repositioned to reflect that the machine's current state has been changed and other windows will be updated accordingly.
Right Clicking with the mouse
When the user right clicks with the mouse, a pop-up menu will appear that enables the user to choose whether to display return values, parameter types or parameter values. Other options such as Pane Operations and Changing Pane Type will also be present on the context menu. A check mark alongside a menu item indicates that the choice is selected. To deselect an option, move to that item and left click with the mouse. The autoexpand menu item, when selected, will cause all parameter details associated with a context to be displayed, providing that at least one parameter detail option is selected.
Comments
Please let me know if you have any comments, suggestions or questions about the Call Stack Display. jago@snsys.com
Overview
The uploader plug-in allows the user to either upload a portion of memory held in the target machine ( e.g Sony PlayStation ) to a file on the host machine ( i.e the PC ) or download a portion of memory held in a file on the host machine to the target machine.
The benefit of such a tool is that it is then possible to save and restore states that a machine's memory was in, prior to an exception occurring.
User interaction
When the uploader dialog appears, the user should first select the mode by clicking one of the radio buttons with the mouse. Only one option can be selected, either to upload or download memory. The default mode is upload.
Uploading memory
When this mode is selected the user has the option of either specifying the end address or the length of the block of memory to upload by clicking on the "Length" check box.
Downloading memory
When this mode is selected only the download address needs to be specified, since the size of memory to be downloaded is calculated from the size of the file from which memory is being downloaded.
Use of the expression manager
Clicking on the box with three dots on it will invoke the expression manager which will allow the user to retrieve an address by entering symbol such as a label.
Binary File Field
This field has to filled in before a user can click OK and exit the dialog. The user can either enter the filename ( including the path ) or click on the "Browse" button to retrieve a filename and path. If the user is uploading memory, the user will be asked to supply a filename to which the portion of memory should be saved to. If downloading memory from the host to the target, the user will be asked for a file from which to get the memory.
Use of history lists
Next to each of the edit fields there is a downward pointing arrow. Clicking on this will reveal a list of previously used addresses or, in the case of the binary file field, files. The most recently used items will appear at the top of the list.
Cancel
When the user presses this the dialog is ended and no memory is uploaded or downloaded.
OK
Upon pressing this button, depending on which mode has been selected, an attempt is made to upload or download the memory. Errors resulting from this action will be displayed in the File Server Window ( in due course ). Any addresses / files used will be added to history lists so that they will appear in the drop down lists that accompany each edit field.
The plug-in manager is used to manage the installed plug-ins on your system. SN Systems may ship plug-ins separate from the main debugger installation. Plug-ins have a .pqx extension. Double click on a .pqx file in an explorer window to install the plug-in. Choose 'yes' to copy it to the default location in the psyq_win directory.
Overview
The expression manager dialog is used by things like 'add watch' to allow you to enter an expression. The new dialog has enhanced features for browsing and selecting various types of symbols. It also allows you to copy or paste expressions to/from the expression clipboard, evaluate expressions on the spot, name complete and choose from a history list of previous expressions.
Expression Dialog
The Expression dialogue box is used to enter and evaluate new expressions. It is comprised of the following features:
Name Completion
When entering an expression in the 'Current Expression' edit box, name completion is available. Name completion takes the text fragment from the left of edit cursor and matches it to the beginning of debugging symbols within the current scope. If a single match is found then the text is replaced by the complete symbol. If more than one match is found, then a separate window is brought up showing the matching symbols sorted in alphabetical order. One symbol can then be selected from the list to be inserted in the expression or press ESCAPE to cancel.
Name Completion can be done by clicking on the 'Complete' button or by pressing Alt-C in the edit box.
Symbol Group
By default, all available symbols are matched during name completion. This can be changed to match only symbols of a specific group by selecting an alternative from the 'Symbol Group' list. You can choose between All Symbols, Globals, Locals, Functions, Types or assembler Labels only. The symbol group selected here is also the initial group displayed by the Symbol Browser.
Browser
Clicking on the 'Browser' button or pressing Alt-B will bring up the Symbol Browser which shows all the symbols in the current scope and also their details.
Evaluation
At any time the current expression can be evaluated by clicking on the 'Evaluate' button or by typing Alt-E. If the expression can be evaluated then its value will be displayed in the adjacent window, else a suitable error will be given.
Expression Clipboard
The current expression can be copied into the debugger's Expression Clipboard to be recalled later within other debugger components. This is done by clicking on the 'Copy Current' button or by pressing Alt-Y. The expression text is also copied into Windows Clipboard at the same time to be used by other Windows applications.
The contents of the Expression Clipboard can also be inserted into the current expression by clicking on 'Paste Current' or by typing Alt-P.
Symbol Browser
The Symbol Browser lists the available symbols in the current scope and also shows any relevant details. These details are as follows:
- Name: Simply the name of the symbol as it would appear in your code
- Type: For storage variables, its type (e.g. int, float); for functions, its return type
- Class: 'C' class of the symbol - e.g. automatic, static, union, typedef, etc
- Location: The memory location or position relative to the stack the symbol refers to, if applicable to the symbol
- Dims: The dimensions of the symbol if it represents an array and also the number of bytes the array occupies
- Tag: The structure or enumerator tag if applicable
To display the Symbol Browser, click on the 'Browse' button on the Expression Dialog or press Alt-B.
Symbol Group
Selects the group of symbol you are interested in. Only symbols of the group specified are displayed. Together with wildcard matching, this provides a very powerful way of displaying only the symbols you are interested in.
Wildcard Matching
Works together with the specified Symbol Group to display only certain symbols. The Wildcard text is entered in the edit box on the browser's tool bar and works as with DOS Wildcard matching. A '*' character will match 0 to any number of text characters, while a '?' character will match any single text character. All other characters will match only the equivalent text character. For example, typing "m*?n" will match all symbols in the current group that start with 'm', end in 'n' and have at least one character between. The 'C' function name 'main' is an obvious match.
Sorting
All displayed symbols are sorted and displayed in alphabetical name order by default. The symbols can also be sorted by any of the other detail columns by clicking on the heading name for each of the columns.
Selecting
Clicking or pressing RETURN on any of the symbol names will close the Symbol Browser and insert the symbol into the current expression in the Expression Dialog.
The debugger uses a series of fixed blocks to store the various types of symbol information. It does this so that symbol loading time and debugger close down time is minimised. One side-effect of this is that heap space might be wasted if the fixed block heap is larger than is actually needed. Although wasted heap space will eventually be paged out to disk, it still makes demands on the OS at debugger start up time and still occupies space in the page file. In fact, previous versions of the debugger typically had a default heap requirement tailored for fairly hefty projects.
v2.0 introduces smarter management of this heap requirement and the opportunity for user intervention in specifying the default behaviour of the fixed block heap.
When a project that contains a symbol file is closed, the debugger sets the default fixed block size according to the actual size of the symbol file. It also adds on room for 5% growth in symbol information. This default size is also stored with the project in the project file. Next time the project is opened, the symbol file should fit tightly into a heap just big enough to contain it. This scheme minimises both wasted heap space, the need for the OS to page and symbol loading time. If the symbol file grew by more than 5%, the first time it is loaded there will be a penalty. However, subsequent loads will not attract this penalty.
In the event that the debugger's heap requirement cannot be fulfilled by the OS, the debugger terminates during the loading process. This can happen for one of three reasons:-
The default fixed block size is too large
The symbol file grew by more than 5% and the extra heap requirement to load it is too high
There is not enough virtual memory for the symbol file at all
3 can only be solved by adding more physical memory or ensuring that the OS page file is enabled and there is enough room for it to expand. 1 and 2 can be solved by running the debugger with the /minheap option. This will set the fixed block size to something much smaller and hopefully will enable the symbol file to be loaded successfully.
If you are curious about actual heap usage, press Ctrl+Shift+I to see a summary.
Heap management can be switched off altogether and the default block size set by the user. Also, the default growth size of 5% can be increased or decreased. See the 'Things you can change' article for more information.
The debugger stores configuration information in the registry. Some of this information is not modifiable using the debugger's UI but you can add or change registry settings to tailor the debugger to your needs. If a registry value is not present, the debugger uses a default value so you can change it's behaviour by adding the name to the registry and specifying a different value.
All of these values are stored in the HKEY_CURRENT_USER\Software\SN Systems\Psy-Q Debugger\Parameters key
| Value | Type | Default | Behaviour |
|---|---|---|---|
| IndicatorFontSize | DWORD | (Windows) | The size of the font used in indicator windows. (e.g. source file name) |
| IndicatorFont | STRING | (Windows) | The font used in an indicator window |
| IndicatorShowFileOnly | DWORD | FALSE | Show only the file name in the indicator in a source pane |
| IndicatorLowerCase | DWORD | FALSE | Convert the file name to lower case |
| ConfirmDownloadOnProjectOpen | DWORD | FALSE | Ask before downloading binary or cpe files during a project open |
| ObjectsInFixedBlockDef | DWORD | 30,000 | Number of objects in the fixed block heap for Def records. This will be overwritten if AdvancedHeapMan is TRUE |
| ObjectsInFixedBlockFun | DWORD | 1,000 | " " for Function records |
| ObjectsInFixedBlockBlock | DWORD | 1,000 | " " for Block records |
| ObjectsInFixedBlockFile | DWORD | 100 | " " for File records |
| ObjectsInFixedBlockLine | DWORD | 15,000 | " " for Line records |
| AdvancedHeapMan | DWORD | TRUE | Allow debugger to manage size of fixed block heap |
| AdvancedHeapPercent | DWORD | 5% | Optimise for a symbol file growth of this percent. Only valid if AdvancedHeapMan is TRUE |
| ExpressionPaneWidth | DWORD | 512 | Width of the horizontal scroll bar in characters when it is displayed in an expression pane |
| SourcePaneWidth | DWORD | 1024 | Width of the horizontal scroll bar in characters when it is displayed in an source pane |
| ShowLabelsInMemory | DWORD | TRUE | Show nearest label information in the status bar in a memory pane |
| CentreOnPC | DWORD | TRUE | Centre the pane on the PC in source and disassembly panes |
| ShowSLIInSourcePane | DWORD | TRUE | Show Source Level Information in the status line when in a source pane |
| OpenLastProject | DWORD | TRUE | Debugger opens the project that was being worked on last time the debugger was open. |
| RestoreWindowPosOnProjectOpen | DWORD | TRUE | Remember the position of the debugger's main window in a project file |
| AskBeforeClosing | DWORD | TRUE | Provide a warning when the debugger is being closed by pressing the 'x' button or by using the system menu. |
| IndicatorTop | DWORD | TRUE | Show the indicator window at the top of a pane (as opposed to the bottom) |
| DisassemblyPaneWidth | DWORD | 256 | Width of the horizontal scroll bar in characters when it is displayed in an disassembly pane |
The following lists includes bug-fixes and general user-interface improvements.
Changes from 1.x to 2.0 10_0
Changes from 10_0 to 10_1
Changes from 10_1 to 10_2
Changes from 10_2 to 10_3
Changes from 10_3 to 10_4
Changes from 10_4 to 10_5
Changes from 10_5 to 10_6
These are some notes of things that we know are wrong with the debugger and intend to resolve during the v2.0 beta.
Other
The following general features are planned for v2.1. Work will start on v2.1 in January although a completion time has not yet been estimated.
Other ideas in consideration but with no schedule:-
If you have found something in the debugger that appears to be a bug, then please report it to SN Systems. The following information will help us identify the problem:-