Eclipse TITAN 'Debug As' profile [message #1749144] |
Fri, 02 December 2016 05:12  |
Eclipse User |
|
|
|
Hi All,
In Eclipse Titan project, in there is 'Run As', there is a profile 'TITAN Parallel Launcher'. I would like to create a 'Debug As' profile to debug my ports and external functions code, in the same way.
Does someone know how to do it?
Many thanks in advance for your help,
Best Regards,
Yann
|
|
|
Re: Eclipse TITAN 'Debug As' profile [message #1749292 is a reply to message #1749144] |
Mon, 05 December 2016 04:07   |
Eclipse User |
|
|
|
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 05:33] by Moderator
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.08927 seconds