5
|
1 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
|
|
2 |
<html lang="en">
|
|
3 |
|
|
4 |
<head>
|
|
5 |
<meta http-equiv="Content-Language" content="en-us">
|
|
6 |
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
|
|
7 |
<meta name="ProgId" content="FrontPage.Editor.Document">
|
|
8 |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
|
9 |
<title>Debugging a program</title>
|
|
10 |
<link rel="stylesheet" type="text/css" href="../help.css">
|
|
11 |
</head>
|
|
12 |
|
|
13 |
<body>
|
|
14 |
|
|
15 |
<h1>Debugging a program</h1>
|
|
16 |
|
|
17 |
<p>You must create a debug launch configuration the first time you debug your
|
|
18 |
program.</p>
|
|
19 |
|
|
20 |
<p>To create a debug configuration:</p>
|
|
21 |
|
|
22 |
<ol>
|
|
23 |
<li>In C/C++ Projects view, select a project.
|
|
24 |
</li>
|
|
25 |
<li>Click <b>Run > Debug</b>.</li>
|
|
26 |
<li>In the Debug dialog box, select a debug configuration type from the <b>Configurations</b>
|
|
27 |
list.</li>
|
|
28 |
<li><p>Click <b>New</b>.</p></li>
|
|
29 |
<li>In the <b>Name</b> box, type a descriptive name for this debug configuration.</li>
|
|
30 |
<li>In the <b>Project</b> box, type the name of the project containing
|
|
31 |
the application you want to debug.</li>
|
|
32 |
<li>In the <b>C/C++ Application</b> box, type the name of the executable
|
|
33 |
that you want to run.</li>
|
|
34 |
<li>Click <b>Debug</b>.</li>
|
|
35 |
<p>The debug perspective is opened and the application window opens on
|
|
36 |
top. The C/C++ editor window is repositioned in the perspective.</p>
|
|
37 |
</ol>
|
|
38 |
|
|
39 |
<p>For more information:</p>
|
|
40 |
<ul><li>To specify the
|
|
41 |
execution arguments an application uses and the working directory for a run
|
|
42 |
configuration, see <a href="cdt_t_run_arg.htm">Specifying execution arguments</a>.</li><li>To set the environment variables
|
|
43 |
and values to use when an application runs, see <a href="cdt_t_run_env.htm">
|
|
44 |
Setting environment variables</a></li>
|
|
45 |
<li>To select a debugger to use when debugging an application, see
|
|
46 |
<a href="cdt_t_run_dbg.htm">Selecting a debugger</a></li>
|
|
47 |
<li>To specify the location of source files used when debugging a C or C++
|
|
48 |
application, see <a href="cdt_t_run_source.htm">Specifying the location of
|
|
49 |
source files</a></li>
|
|
50 |
<li>To specify where the run configuration is stored, how you access it and
|
|
51 |
what perspective to open when running an application, see
|
|
52 |
<a href="cdt_t_run_com.htm">Specifying the location of the run configuration</a></li></ul>
|
|
53 |
|
|
54 |
<p>To use a debug configuration:</p>
|
|
55 |
|
|
56 |
<p>You can reuse a previously created debug launch configuration to debug your
|
|
57 |
program.</p>
|
|
58 |
|
|
59 |
<ol>
|
|
60 |
<li>Click <b>Run > Debug</b>.</li>
|
|
61 |
<li>In the Debug dialog box, select a debug configuration from the Configurations
|
|
62 |
list.</li>
|
|
63 |
<li>Click <b>Debug</b>. </li>
|
|
64 |
</ol>
|
|
65 |
|
|
66 |
<p><img border="0" src="../images/ngconcepts.gif" ALT="Related concepts" width="143" height="21">
|
|
67 |
<br>
|
|
68 |
<a href="../concepts/cdt_c_over_dbg.htm">Debug overview</a><br>
|
|
69 |
<a href="../concepts/cdt_c_dbg_info.htm">Debug information</a></p>
|
|
70 |
<p><img border="0" src="../images/ngtasks.gif" ALT="Related tasks" width="143" height="21">
|
|
71 |
<br>
|
|
72 |
<a href="cdt_o_debug.htm">Debugging</a></p>
|
|
73 |
<p><img border="0" src="../images/ngref.gif" ALT="Related reference" width="143" height="21">
|
|
74 |
<br>
|
|
75 |
<a href="../reference/cdt_o_run_dbg_pages.htm">Run and Debug dialog box</a></p>
|
|
76 |
<img src="../images/ng00_04a.gif" ALT="IBM Copyright Statement" >
|
|
77 |
|
|
78 |
</body>
|
|
79 |
|
|
80 |
</html> |