|
Re: Eclipse TITAN 'Debug As' profile [message #1749292 is a reply to message #1749144] |
Mon, 05 December 2016 09:07 |
|
Hi Yann,
I don't see exactly what the problem is.
Possibilities:
1. How to implement a menu item under "Run As"
2. How to create a titan compilation in debug mode and debug the whole C++ code - the titan itself and the user code (C++ code generated from ttcn and C++ code from test ports and external functions)
This should be studied at first in command line (gdb supported debug) then in the eclipse supported C++ debugger. If you are interested in this question we can inform you how to compile in debug mode.
Most cases the simple old println in the code is useful and enough and the best.
3. There is a built in debugging to debug test ports and external functions into log files or console, see
help/docs/apiguide.pdf . A small detail:
"If there are many points in the Test Port code that want to log something, it can be a good practice to write a common log function in the Test Port class. We show here an example function, which takes its arguments as the standard C function
printf
and forwards the message to the Test Executor's logger:
#include <stdarg.h>
// using in other member functions:
// log("The value of i: %d", i);
void MyPortType::log(const char *fmt, ...)
{
// this flag can be a class member, which is configured through a
// test port parameter
if (logging_is_enabled) {
va_list ap;
va_start(ap, fmt);
TTCN_Logger::begin_event(TTCN_DEBUG);
TTCN_Logger::log_event("Example Test Port (%s): ", get_name());
TTCN_Logger::log_event_va_list(fmt, ap);
TTCN_Logger::end_event();
va_end(ap);
}
} "
[Updated on: Mon, 05 December 2016 10:33] Report message to a moderator
|
|
|
|
Re: Eclipse TITAN 'Debug As' profile [message #1749487 is a reply to message #1749483] |
Wed, 07 December 2016 10:11 |
|
Hi Yann,
Our team member, Lenard run into a similar problem. We haven't tried to debug C++ test ports of titan in Eclipse yet but we started to investigate it. We send feedback if we had progress.
We should use CDT resources in Titan projects.
At first glance adding C++ feature to TITAN project and debug it as C++ project is possible. In this case the whole titan source code (in C++) should be used as referred project.
If breakpoints were place only in the test port(s), you can use it.
Debugging on ttcn3 level has not been supported yet in Eclipse. Titan has only CLI debugger feature in language ttcn3 ( and/XOR C++ debugger.
BR
Jeno
|
|
|
|
Powered by
FUDForum. Page generated in 0.02973 seconds