RAD Studio (Common)
ContentsIndex
PreviousUpNext
Debugging Procedures

This section provides how-to information on debugging applications.

Name 
Description 
Add a watch to track the values of program variables or expressions as you step over or trace into code. Each time program execution pauses, the debugger evaluates all the items listed on the Active tab (or ActiveWatchGroup) in the Watch List window and updates their displayed values.
You can organize watches into groups. When you add a watch group, a new tab is added to the Watch List window and all watches associated with that group are shown on that tab. When a group tab is displayed, only the watches in that group are evaluated during debugging. By grouping... more 
The CPU view displays the assembly language code for your program. 
When you debug an application, you can inspect the values of members within a watched object whose type is a complex data object (such as a class, record, or array). These values display in the Watch List window when you expand a watched object. Additionally, you can expand the elements within an object, displaying its sub-elements and their values. You can expand all levels in the object. Members are grouped by ancestor. 
You can attach to a process that is running on your computer or on a remote computer. This is useful for debugging a program that was not created with RAD Studio. 
Breakpoints pause program execution at a certain location or when a particular condition occurs. You can set source breakpoints and module load breakpoints in the Code Editor before and during a debugging session. You can set data breakpoints and address breakpoints only when the application is running in debug mode (F9),
Procedures described in this Topic:
  • To set a source breakpoint
  • To set an address breakpoint
  • To set a data breakpoint
  • To set a module load breakpoint
  • To create a breakpoint group
  • To enable or disable a breakpoint or a breakpoint group
  • To create a conditional breakpoint
  • To associate actions... more 
To debug VCL for .NET source code, you must set certain project options that are not needed when debugging other types of applications. The options are off by default and must be specifically set. 
When you debug an application, you can display the values of members within a watched object whose type is a complex data object (such as a class, record, or array). These values display in the code editor window when you expand a watched object. Additionally, you can expand the elements within an object, displaying its sub-elements and their values. You can expand all levels in the object. Members are grouped by ancestor. 
The Debug Inspector lets you inspect data elements by automatically formatting the type of data it is displaying. The Debug Inspector is especially useful for examining compound data objects, such as arrays and linked lists. Because you can inspect individual items displayed in the Debug Inspector, you can perform a walkthrough of compound data objects by opening a Debug Inspector on a component of the compound object.
Note: The Debug Inspector
is only available when the process is stopped in the debugger.  
After you have evaluated a variable or data structure item, you can modify its value. When you modify a value through the debugger, the modification is effective for the program run only. Changes you make through the Evaluate/Modify dialog box do not affect your source code or the compiled program. To make your change permanent, you must modify your source code in the Code Editor, then recompile your program. 
While most debugging options are set on by default, you can use the following procedures to review and change those options. There are both general IDE options and project specific options. The project specific options vary based on the active project type, for example, Delphi, Delphi .NET, or C#. 
Remote debugging lets you debug a RAD Studio application running on a remote computer. Once the remote debug server is running on the remote computer, you can use RAD Studio to connect to that computer and begin debugging. 
Remote debugging lets you debug a RAD Studio application running on a remote computer. Once the remote debug server is running on the remote computer, you can use RAD Studio to connect to that computer and begin debugging.
Prerequisites and security considerations for remote debugging
  • The local and remote computers must be connected through TCP/IP.
  • All of the files required for debugging the application must be available on the remote computer before you begin debugging. This includes executables, DLLs, assemblies, data files, and PDB (debug) files.
  • In addition to the port that the remote debug server listens on, a connection... more 
To debug a project on a machine that does not have RAD Studio installed, you must install the remote debugger executable files. You can install these files either directly from the installation disk or by copying them from a machine that has RAD Studio installed. 
You must establish a TCP/IP connection between the local and remote machines in preparation for remote debugging. This connection uses multiple ports that are chosen dynamically by Windows. The remote debug server listens on one port, and a separate port is opened for each application that is being debugged. A firewall that only allows connections to the listening port will prevent the remote debugger from working.
Note: If the remote machine uses the firewall included with Windows XP service pack 2, you will receive a message asking whether CodeGear remote debugging service should be allowed. You must indicate that this... more 
Executable files and symbol files must be copied to the remote machine after they are compiled. You must set the correct options on your local machine in order to generate these files. 
Symbol tables are used internally during debugging. By default, RAD Studio locates and uses all symbol tables available. However, you can control the order in which these symbol tables are searched. You can also limit the search to specific symbol tables, which can speed up the debugging process.
The extensions for symbol table files vary by personality.
  • Delphi Win32, does not use external symbol files because the compiler holds the symbols tables in memory. However, if you are debugging a remote application, you must generate symbol files with the .RSM extension.
  • Delphi.NET, VB.NET and C# symbol files use the .PDB... more 
The error message, Internal Error: X1234 indicates that the compiler has encountered a condition, other than a syntax error, that it cannot successfully process.
Tip: Internal error numbers indicate the file and line number in the compiler where the error occurred. This information may help Technical Support services track down the problem. Be sure to record this information and include it with your internal error description.
 
Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!