The code inspector
The code inspector is used to view and disassemble the 32 bit code which is loaded in the address space of the debuggee or in shared memory:-
Creating a code inspector
There are 5 ways to create a code inspector:-
Unresolved code in a code inspector
If the code inspector cannot resolve the code into mnemonics the most likely reason for this is that the code is, in fact, 16-bit code, rather than 32-bit code. In that case the code inspector might look something like this:-
Here GoBug is showing lines which it cannot resolve starting with "XX-" followed by the next 8 opcodes (only 6 visible on this pane).
Last viewable code in a code inspector
The last viewable area of code in a code inspector is the end of raw data in the section. After this the section may be padded with zeroes up to the end of the section in memory: these areas are not shown by the code inspector. Some programs might use this area of memory to store data. To view this part of the section use a data inspector.
Viewing opcodes in a code inspector
You can view the opcodes of individual lines in a code inspector by switching on the "opcodes mouseover" switch. This causes the opcodes under the mouse cursor to be displayed. You can find this switch in the context menu if you right click on the inspector.
The data inspector
The data inspector can be used to view any readable area of memory in the debuggee's address space or in shared memory. The view is byte-by-byte. Owing to reverse-order storage, this means that dwords and words will appear in reverse, ie. a dword of value 12345678h will appear as 78 56 34 12, and a word of value 1234h will appear as 34 12. Bytes will appear in the correct order.
Creating a data inspector
There are several ways to create a data inspector:-
Special types of data inspectors
The data inspector may show what is known about the area currently being looked at. For example,
here GoBug knows that the address being looked at is in the "DATA" section of the debuggee.
If the data inspector was created using the "inspect, data by register"menu item then you can track the register by clicking the track button. This will renew the contents of the inspector starting at the current value of the register concerned.
If the data inspector was created using the data symbol dialog the inspector has a different display - starting a new line for each symbol, for example:-
Note that this type of inspector views bytes in the data area in sequence. If you want to view symbols which are not in sequence, then use a symbol inspector (see below).
The symbol inspector
The symbol inspector is used to view the contents of data symbols whilst debugging. With this type of inspector you can view several symbols in one inspector even if their addresses are not adjacent.
Creating a symbol inspector
Use the "inspect, new symbol inspector" menu item. In the symbol inspector click on "add item" to add a symbol to the list of symbols in the inspector. You will be asked how you want the symbol to be represented (as bytes, words or dwords). To delete a symbol click on it to highlight it and then click "delete item".
In this symbol inspector the first symbol in the inspector is "CHILD_CLASSNAME" which is at address 413897h, is represented in BYTE format and which is a null-terminated string of 4 bytes containing "MCC". BYTE_TESTER is a structure of 2 dwords at address 413FADh. The inspector is given the title of the last symbol added so that it can be identified easily.
Displayed size of each symbol
GoBug assesses the size of each symbol from the debug information embedded in the debuggee, or from the symbol file (Dbg or Map file). If there are two symbols at the same data address, GoBug will regard the first as merely a label containing no data. Use the second symbol name in the symbol inspector.
If GoBug has taken the symbols from a map file, it may be that GoBug does not know the size of the very last symbol in the map file and it may be wrongly represented in the symbol inspector.
Using the keyboard in symbol inspector
Instead of using the mouse to perform actions in the symbol inspector you can use the following keys:-
a - add an item
d - delete an item which is highlighted
TAB - highlight a visible item
ShftTAB - remove highlight
See also scrolling the inspectors.
How many inspectors you may create
In theory there is no limit.
Scrolling the inspectors
Using the mouse you can scroll by clicking on the scrollbar arrows or scroll bar shaft or by dragging the scroll box.
The keyboard interface (when the inspector has the focus) is as follows:-
UpArrow and DnArrow - move up or down one line and scroll at extremes.
CrtlUpArrow and CrtlDnArrow - move to top or bottom of the page.
PgUp and PgDn - move up or down one page.
CrtlPgUp and CrtlPgDn - move up or down by one-sixtyfourth of the scrollbar range (scrolls quite quickly).
ShftCrtlPgUp and ShftCrtlPgDn - move up or down by one-sixteenth of the scrollbar range (scrolls very quickly).
CrtlHome and CrtlEnd - go to beginning or end of the scrollbar range.
Refreshment of the inspectors
The contents of the inspectors are refreshed immediately after each single step. If you want to refresh the inspectors at any other time use the "inspect, refresh all panes/inspectors" menu item. You can also use this menu item to make sure that the memory areas reported by the data inspectors are up to date. Some of these may change their address.
Repeating an inspector in a new session
You can keep your inspectors for use in a new debug session by leaving them open when you use the "file, restart debuggee" menu item. If you then start a new session with the same debuggee, the title of the inspector will appear on the menu. See sessions. GoBug also remembers (in a drop-down combo box) the last 10 addresses in data and code inspectors if you specifically entered them.
Dumping the inspectors
Ensure that the inspector and the data you want to dump is visible, and go to the menu item "file, dump". Click on the appropriate inspector which will appear in the menu item. Alternatively right click on the pane and choose "dump the pane". Choose a file name for the dumped file (GoBug will suggest a name). Choose a path for the file to be written (GoBug will remember this for the next time you debug this particular exe). Choose the type of file to make (use ANSI unless you want to make a Unicode file because you are using non-Roman characters). If dumping a data or code inspector you may change the starting point and size of the dump. Even if the inspector has been maximised the dump will be limited to the starting size of the inspector. Symbol inspectors are always dumped in full. The file which is created on this dump is plain text with carriage returns and line feeds but no tabs. It is usually best to view the dumped file with an editor set to a fixed width font (as opposed to a proportionally spaced font).
Printing the inspectors
Ensure that the inspector and the data you want to print is visible and go to the menu item "file, print". Click on the appropriate inspector which will appear in the menu item. Alternatively right click on the pane and choose "print the pane". If printing a data or code inspector you may change the starting point and size of the print. Symbol inspectors are always printed in full (the number of pages appears in the print dialog). You can change the font used for printing by using the "settings, fonts, when printing" menu item.