Function breakpoints, conditional breakpoints, watchpoint, and the continue and finish commands

In this example, we will learn how to set function breakpoints, conditional breakpoints, and use the continue command. Then, we will learn how to finish a function call without the need to execute all the code lines in a step by step format. The source code is as follows:

//ch13_gdb_2.cpp#include <iostream>float dotproduct( const float *x, const float *y, const int n);int main(){ float sxx,sxy; float x[] = {1,2,3,4,5}; float y[] = {0,1,1,1,1}; sxx = dotproduct( x, x, 5); sxy = dotproduct( x, y, 5); printf( "dot(x,x) = %f\n", sxx ); printf( "dot(x,y) = %f\n", sxy ); return 0;}float dotproduct( const float *x, const float *y, const int n ){ const ...

Get Expert C++ now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.