1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-12 10:45:37 +02:00
cdt/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/data/launch/src/CatchpointTestApp.cc
Simon Marchi c389f49659 [dsf-gdb] debug tests: Use line tags where possible
The goal is to eliminate direct source line number references in tests,
so that modifying test cases is easier.

Change-Id: I9a4964478e9486bff137fb9aec199cee144c2af4
Signed-off-by: Simon Marchi <simon.marchi@polymtl.ca>
2016-12-03 18:08:14 -05:00

28 lines
570 B
C++

#include <iostream>
#include "Sleep.h"
int g_i = 0;
int main() {
for (; g_i < 8; g_i++) {
try {
std::cout << "Throwing exception" << std::endl;
throw 1;
}
catch (int exc) {
std::cout << "Exception caught" << std::endl;
}
}
// For setting a catchpoint while target is running
std::cout << "Sleeping..." << std::endl;
SLEEP(2); // LINE_NUMBER_SLEEP_CALL
std::cout << "...awake!" << std::endl;
try {
std::cout << "Throwing exception" << std::endl;
throw 1;
}
catch (int exc) {
std::cout << "Exception caught" << std::endl;
}
return 0;
}