Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Titan » Eclipse TITAN 'Debug As' profile(Eclipse Titan Debug C++)
Eclipse TITAN 'Debug As' profile [message #1749144] Fri, 02 December 2016 10:12 Go to next message
Yann Garcia is currently offline Yann GarciaFriend
Messages: 145
Registered: June 2016
Senior Member
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 09:07 Go to previous messageGo to next message
Jeno Attila Balasko is currently offline Jeno Attila BalaskoFriend
Messages: 80
Registered: September 2013
Location: Budapest, Hungary
Member

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 #1749483 is a reply to message #1749292] Wed, 07 December 2016 09:25 Go to previous messageGo to next message
Yann Garcia is currently offline Yann GarciaFriend
Messages: 145
Registered: June 2016
Senior Member
Hello Jeno,

Thanks a lot for this information.
I think I was not clear in my request: into Eclipse, I want to be able to put break points in my own code and also in TITAN source code. I rebuilt TITAN with debug options (-g...), but in my Eclipse project, I cannot set up a Debug profile to execute my TITAN project.
I think I miss something, but I cannot find what I missed.

Thanks again for your help,

Yann
Re: Eclipse TITAN 'Debug As' profile [message #1749487 is a reply to message #1749483] Wed, 07 December 2016 10:11 Go to previous messageGo to next message
Jeno Attila Balasko is currently offline Jeno Attila BalaskoFriend
Messages: 80
Registered: September 2013
Location: Budapest, Hungary
Member

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
Re: Eclipse TITAN 'Debug As' profile [message #1749565 is a reply to message #1749487] Thu, 08 December 2016 08:38 Go to previous message
Yann Garcia is currently offline Yann GarciaFriend
Messages: 145
Registered: June 2016
Senior Member
Hello Jeno,

Many tanks for your help,
In the meantime, I'm going to try in command line on Linux with GDB.

Thanks again

Yann


Previous Topic:Can't find "RT1/PreGenRecordOf.hh" when build
Next Topic:Titan Architecture Internals: On the difference between the bool and boolean types
Goto Forum:
  


Current Time: Tue Apr 16 13:02:08 GMT 2024

Powered by FUDForum. Page generated in 0.61682 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top