The home page is now at www.kdbg.org.
[kdbg.git] / kdbg / doc / en / howdoi.html
blob6191144e1af2cfb2fe663324ffa77849ecf35255
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2 <html>
3 <head>
4 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
5 <meta name="Author" content="Johannes Sixt">
6 <title>KDbg - User's Manual - How Do I...?</title>
7 </head>
8 <body text="#000000" bgcolor="#FFFFFF">
9 <p><a href="index.html">Contents</a></p>
10 <h1>
11 How Do I...?</h1>
13 <h4>
14 ... set breakpoints?</h4>
15 <p>There's more than one way to set a breakpoint:</p>
16 <ul>
17 <li>
18 You can set it in the source window by clicking on the "active area" at
19 the far left of the line.</li>
21 <li>
22 You can set it by selecting the line in the source window and choosing
23 an option from the <i>Breakpoint</i> menu.</li>
25 <li>
26 You can set it in the <a href="breakptlist.html">breakpoint list</a>.</li>
27 </ul>
28 <p>If you can't set breakpoints, maybe the program is currently running. You
29 can't set breakpoints while the program is running. Stop it first using
30 <i>Execution|Break</i>.
31 If you still can't set breakpoints, make sure that you have compiled <em>and
32 linked</em> your program with debugging information enabled.</p>
33 <h4>
34 ... display the value of a global variable or an arbitrary expression?</h4>
35 <p>Use the <A href="watches.html">Watch window</A>.</p>
36 <h4>
37 ... set watchpoints?</h4>
38 <p>Watchpoints are manipulated in the <a href="breakptlist.html">breakpoint
39 list</a>.</p>
40 <h4>
41 ... use a core dump?</h4>
42 <p>First load the executable using <i>File|Executable</i>, then specify the
43 core dump using <i>File|Core dump</i>.</p>
44 <h4>
45 ... debug a program that's caught in an endless loop?</h4>
46 <p>Start the program and let it run until it is in the endless loop. Then
47 switch to KDbg and choose <i>Execution|Break</i>. You've just caught the
48 nasty program <em>in flagranti</em>!</p>
49 <h4>
50 ... achieve that the program passes over a breakpoint a number of times
51 before it stops?</h4>
52 <p>In the <a href="breakptlist.html">breakpoint list</a> select the breakpoint;
53 then click <i>Conditional</i> and specify the number of times to skip the
54 breakpoint in the <i>Ignore count</i> field.</p>
55 <h4>
56 ... set environment variables for the executable?</h4>
57 <p>Select <i>Execution|Arguments</i> and specify the environment variables
58 in the <a href="argspwdenv.html#Environment">program arguments dialog</a>.</p>
59 <h4>
60 ... set a working directory for the executable?</h4>
61 <p>Select <i>Execution|Arguments</i> and specify the working directory in
62 the <a href="argspwdenv.html#WorkingDir">program arguments dialog</a>.</p>
63 <h4>
64 ... get rid of this terminal window?</h4>
65 <p>Select <i>Settings|This Program</i> and switch to the <a href="pgmsettings.html#output">Output</a> tab.
66 Select <i>Only output, simple terminal emulation</i> and click <i>OK</i>.
67 Now restart the program (choose it from the list under <i>File|Recent Executables</i>).
68 The program output goes now to the built-in <a href="pgmoutput.html">output
69 window</a> and stdin is redirected to <tt>/dev/null</tt>.</p>
70 <p>You must do this for every new program that you debug.</p>
71 <p><b><i>Important:</i></b> You should not do this if your program expects
72 input from the terminal (usually stdin) or if its output requires nifty
73 terminal emulation (more than carriage-return and line-feed). The built-in
74 output window does not support input and terminal emulation.</p>
75 </body>
76 </html>