03.12.2012 Views

C++ for Scientists - Technische Universität Dresden

C++ for Scientists - Technische Universität Dresden

C++ for Scientists - Technische Universität Dresden

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

238 CHAPTER 10. PROGRAMMING TOOLS<br />

10.2.2 Debugging with graphical interface: DDD<br />

More convenient than debugging on a text level is using a graphical interface like DDD (Data<br />

Display Debugger). It has more or less the same functionality as gdb and in fact it runs gdb<br />

internally. One can use it also with another text debugger.<br />

As case study, we use a modified example from Section 5.4.5. In fact, the buggy program arose<br />

by teaching § 5.4.5, i.e. one of the authors tried to reconstruct vector unroll example2.cpp<br />

on the fly.<br />

TODO: Find a better example. The above finally was okay, the tuning just did not change the<br />

run-time behaviour.<br />

In addition to the window above you will see a smaller one like in Figure 10.1, typically on the<br />

right of the large window if there is enough space on your screen.<br />

This control panel let you geer through the debug session in way that is<br />

easier <strong>for</strong> beginner and even <strong>for</strong> some advanced users more convenient.<br />

You have the following command:<br />

Run Start or restart your program.<br />

Interrupt If your program does not terminate or does not reach the next<br />

break point you can stop it manually.<br />

Step Go one step <strong>for</strong>ward. If your position is a function call, jump into<br />

the function.<br />

Next Go to the next line in your source code. If you are located on a<br />

function call do not jump into it unless there is a break point set<br />

inside.<br />

Figure 10.1: DDD<br />

control panel

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!