diff --git a/tests/hellodprintf/breakpoints.seer b/tests/hellodprintf/breakpoints.seer new file mode 100644 index 0000000..a9d90e1 --- /dev/null +++ b/tests/hellodprintf/breakpoints.seer @@ -0,0 +1,3 @@ +dprintf -source /nas/erniep/Development/seer/tests/hellodprintf/hellodprintf.cpp -line 17,"Iteration %d Factorial %d\n",n,nfact +break -source /nas/erniep/Development/seer/tests/hellodprintf/hellodprintf.cpp -line 24 +dprintf -source hellodprintf_fortran.f -line 11,"Iteration %d Factorial %d\n",n,nfact diff --git a/tests/hellodprintf/hellodprintf.cpp b/tests/hellodprintf/hellodprintf.cpp index 6551a8a..70f2d53 100644 --- a/tests/hellodprintf/hellodprintf.cpp +++ b/tests/hellodprintf/hellodprintf.cpp @@ -1,13 +1,40 @@ #include #include #include +#include +#include + +FILE* logfile = NULL; extern "C" { -void fortranfunction_ (int* count); + int log_msgxxx (const char* format, ...) { + int n; + va_list args; + // init the variable length argument list + va_start(args, format); + + n = vfprintf(logfile, format, args); + + // cleanup the variable length argument list + va_end(args); + + return n; + } +} + +extern "C" { + void fortranfunction_ (int* count); } int main (int argc, char** argv) { + const char* filename = "logfile.txt"; + logfile = fopen(filename, "w"); + if (logfile == NULL) { + fprintf(stderr, "Failed to open logfile: %s\n", filename); + return 1; + } + int count = 10; int nfact = 1; int n; @@ -19,7 +46,9 @@ int main (int argc, char** argv) { std::cout << std::setw(12) << n << std::setw(14) << nfact << std::endl; } - fortranfunction_(&count); + // fortranfunction_(&count); + + fclose(logfile); return 0; } diff --git a/tests/hellodprintf/logfile.txt b/tests/hellodprintf/logfile.txt new file mode 100644 index 0000000..5b13768 --- /dev/null +++ b/tests/hellodprintf/logfile.txt @@ -0,0 +1,4 @@ +Hello +Hello +Hello +Hello diff --git a/tests/hellogdbserver/breakpoints.seer b/tests/hellogdbserver/breakpoints.seer new file mode 100644 index 0000000..2c8f180 --- /dev/null +++ b/tests/hellogdbserver/breakpoints.seer @@ -0,0 +1,4 @@ +break -source /nas/erniep/Development/seer/tests/hellogdbserver/hellogdbserver.c -line 127 +break -source /nas/erniep/Development/seer/tests/hellogdbserver/hellogdbserver.c -line 116 +catch rethrow +awatch x diff --git a/tests/hellostruct/breakpoints.seer b/tests/hellostruct/breakpoints.seer new file mode 100644 index 0000000..696632c --- /dev/null +++ b/tests/hellostruct/breakpoints.seer @@ -0,0 +1,8 @@ +watch argc +disable $bpnum +rwatch argc + ignore $bpnum 3 +awatch argc + commands + print argc + end diff --git a/tests/helloworld/tracepoints.seer b/tests/helloworld/tracepoints.seer new file mode 100644 index 0000000..f3fbe52 --- /dev/null +++ b/tests/helloworld/tracepoints.seer @@ -0,0 +1,5 @@ +tvariable $trace_timestamp +trace /nas/erniep/Development/seer/tests/helloworld/helloworld.cpp:19 + commands + collect i, argc, argv[i] + end