-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Test program for testing breakpoint conditions.
- Loading branch information
Showing
5 changed files
with
66 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
hellofibonacci | ||
core* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
.PHONY: all | ||
all: hellofibonacci | ||
|
||
hellofibonacci: hellofibonacci.cpp | ||
g++ -g -o hellofibonacci hellofibonacci.cpp | ||
|
||
.PHONY: clean | ||
clean: | ||
rm -f hellofibonacci hellofibonacci.o | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
|
||
A good program to test the "break if condition is met". | ||
|
||
See problem report: | ||
|
||
https://github.com/epasveer/seer/issues/184 | ||
|
||
Use this breakpoint file when running Seer: | ||
|
||
$ seergdb -s --break-load breakpoints.seer hellofibonacci 255 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
break -source /nas/erniep/Development/seer/tests/hellofibonacci/hellofibonacci.cpp -line 23 | ||
break -source /nas/erniep/Development/seer/tests/hellofibonacci/hellofibonacci.cpp -line 29 | ||
condition $bpnum nextTerm > 10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#include <iostream> | ||
#include <stdlib.h> | ||
|
||
int main (int argc, char* argv[]) { | ||
|
||
if (argc != 2) { | ||
std::cout << "usage: " << argv[0] << " N" << std::endl; | ||
return 1; | ||
} | ||
|
||
int t1 = 0; | ||
int t2 = 1; | ||
int nextTerm = 0; | ||
int n = atoi(argv[1]); | ||
|
||
// Check N | ||
if (n < 0) { | ||
std::cout << "Bad value of 'N': " << argv[1] << std::endl; | ||
return 1; | ||
} | ||
|
||
// Displays the first two terms which is always 0 and 1 | ||
std::cout << "Fibonacci Series: " << t1 << ", " << t2 << ", "; | ||
|
||
// Display next terms. | ||
nextTerm = t1 + t2; | ||
|
||
while (nextTerm <= n) { | ||
std::cout << nextTerm << ", "; | ||
t1 = t2; | ||
t2 = nextTerm; | ||
nextTerm = t1 + t2; | ||
} | ||
|
||
// Final EOL | ||
std::cout << std::endl; | ||
|
||
return 0; | ||
} | ||
|