2003-11-28 21:50:02 +00:00
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
< html lang = "en" >
< head >
2004-05-15 20:50:33 +00:00
< meta http-equiv = "Content-Language" content = "en-us" >
< meta http-equiv = "Content-Type" content = "text/html; charset=UTF-8" >
< title > Debugging your project< / title >
< link rel = "stylesheet" type = "text/css" href = "../help.css" >
2003-11-28 21:50:02 +00:00
< / head >
< body >
2007-06-19 19:34:42 +00:00
< h1 > Debugging a project< / h1 >
2003-11-28 21:50:02 +00:00
< p > The debugger lets you control the execution of your program by setting
breakpoints, suspending executed programs, stepping through your code, and
examining the contents of variables.< / p >
< p > To debug a project:< / p >
< ol >
2009-06-15 14:28:09 +00:00
< li > Click < b > Run > Debug Configurations...< / b > .< p > The Debug Configurations dialog opens.< / li >
< li > Double-click < b > C++ Application< / b > .< / li >
2007-06-19 19:34:42 +00:00
< li > In the < b > Name< / b > field, type < b > Hello World< / b > .< / li >
2003-11-28 21:50:02 +00:00
< p > You can now select this debug launch configuration by name the next time
that you debug this project.< / p >
2009-06-15 14:28:09 +00:00
< li > In the < b > Project< / b > box, type < b > hello.exe< / b > . [???????]< / li >
2003-11-28 21:50:02 +00:00
< li > Click < b > Debug< / b > .< / li >
2009-06-15 14:28:09 +00:00
< p > You will be prompted to switch to the Debug Perspective. Click < b > Yes< / b > < / p >
2004-07-20 19:27:45 +00:00
< p > You will now see the debug perspective with the hello.exe application window open.
2007-06-19 19:34:42 +00:00
The C/C++ editor repositions in the perspective.< / p >
2003-11-28 21:50:02 +00:00
< li > In the left margin of the main.cpp window, double-click to set a
breakpoint on:< br >
cout < < " You just entered" < / li >
< li > Click < b > Run > Resume< / b > .< / li >
< li > When prompted, type a value other than 'm'.< br >
The breakpoint will be hit.< / li >
< li > In the Variable view, verify that the variable is not 'm'.< / li >
< li > Click < b > Run > Resume< / b > .< / li >
< li > When prompted, type a value other than 'm'.< / li >
< p > The breakpoint will be hit.< / p >
< li > In the < b > Variable< / b > view, verify that the variable is not 'm'.< / li >
< li > In the < b > Variable< / b > view, right-click the input variable, and select < b > Change
Variable Value< / b > and type < b > 'm'< / b > .< / li >
< li > Click < b > Run > Resume< / b > .< / li >
< p > The output in the hello.exe application window is:< br >
" You just entered m, you need to enter m to exit." < li > Type < b > 'm'< / b > to end the program.< br >
The hello.exe application window closes and the debug session ends. The debug
perspective remains open.< / li >
< / ol >
2007-06-19 19:34:42 +00:00
< p > To learn more about the debugging, see to the related debug conceptual topics.< / p >
2003-11-28 21:50:02 +00:00
< p align = "left" > < a href = "cdt_w_build.htm" >
2009-05-05 20:53:52 +00:00
< img border = "0" src = "../images/ngback.gif" width = "16" height = "16" alt = "Back icon" > < / a > < b > < a href = "cdt_w_build.htm" > Back: Building a project< / a > < / b > < / p >
2003-11-28 21:50:02 +00:00
< p > < img border = "0" src = "../images/ngconcepts.gif" ALT = "Related concepts" width = "143" height = "21" >
< br >
< a href = "../concepts/cdt_c_over_dbg.htm" > Debug overview< / a > < br >
< a href = "../concepts/cdt_c_dbg_info.htm" > Debug information< / a > < / p >
< p > < img border = "0" src = "../images/ngtasks.gif" ALT = "Related tasks" width = "143" height = "21" >
< br >
< a href = "../tasks/cdt_o_debug.htm" > Debugging< / a > < / p >
< p > < img border = "0" src = "../images/ngref.gif" ALT = "Related reference" width = "143" height = "21" >
< br >
< a href = "../reference/cdt_u_dbg_view.htm" > Debug view< / a > < br >
< a href = "../reference/cdt_u_dbg_view.htm" > Debug launch controls< / a > < br >
< / p >
< p >
2007-06-19 19:34:42 +00:00
< img src = "../images/ng00_04a.gif" ALT = "QNX Copyright Statement" >
2003-11-28 21:50:02 +00:00
< / body >
< / html >