How to debug the OMNeT++ project?

3,594 views
Skip to first unread message

pohl

unread,
Jan 4, 2010, 10:39:13 PM1/4/10
to omnetpp
Hi, body!

I am applying INET-framework for "MPLS multicast" simulation.

I just create a new project in omnetpp (IDE), and do as the example in
INET giving some configuration files (like lib. fec and etc) in the
project folder under the omnetpp/sample fold. My inet-framework
source code is in another folder. I use it just for project
references and I have change some codes.

I follow the tutorial to uncomment CFLAGS='-g -Wall' .
and add in the omnetpp.ini (of my project) debug-on-error = true
But still I can't use gdb to trace the source code.
I use the "EV" to print the output, but My program aborts abruptly. I
have no way of what is going on.

Would you be troubled to give me some tutorial?

Best regards.

Andras Varga

unread,
Jan 5, 2010, 2:41:28 AM1/5/10
to omn...@googlegroups.com
Hi,

In which tutorial did you find "uncomment CFLAGS='-g -Wall'"? So that we can
remove it. It is obsolete (for 3.x).

From the IDE, select the "gcc-debug" built configuration (in the project's
context menu), and rebuilt.

Or, on the command line, the equivalent would be "make MODE=debug".

In the IDE, just use the "Debug" button to launch the simulation.

Regards
Andras

Hi, body!

Best regards.

--

You received this message because you are subscribed to the Google Groups
"omnetpp" group.
To post to this group, send email to omn...@googlegroups.com.
To unsubscribe from this group, send email to
omnetpp+u...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/omnetpp?hl=en.


Andrea Tassi

unread,
Jan 5, 2010, 2:52:44 PM1/5/10
to omn...@googlegroups.com
Hi Andras,

I have the same problems with the debug of inetmanet. I normally use the Eclipse CDT for the C/C++ development but if I put a breakpoint with the Oment++ IDE in any part of inetmanet source cc files, the execution of the simulation (in debug mode) ignores the breakpoint or crashes (it also crashes if I add e "watch expression"!) this happens randomly with the same breakpoint in Ubuntu 9.10 with the latest Sun JDK. In Ubuntu 9.10 there is also another problem: the Tkenv appears with huge font size.

I use Omnet++ also with my Mac, Snow Leopard enables the 64bit support in the system library and gcc by default builds 64bit binaries that the CDT Match-O Parser can't understand. This problem has been reported in https://bugs.eclipse.org/bugs/show_bug.cgi?id=270790 and fixed in the CDT 6.0.2 but it can't be used for upgrade the CDT of Omnet++ IDE because it uses an old version of the Eclipse IDE. For this reasons I can't run the simulation in "debug-mode" with Snow Leopard. This is a problem for me.

Thanks a lot for your help.
Regards
Andrea

Andras Varga

unread,
Jan 6, 2010, 3:44:45 AM1/6/10
to omn...@googlegroups.com
Hi Andrea,

Debug problem: this is likely a CDT and/or gdb issue (we didn't touch the
CDT debugging [or editing] part, only the build process). Please post if you
find out something...

Tkenv huge font size: fonts and font sizes can be changed in the Simulation
Options dialog. Unfortunately what is the right font size in N Linux distros
will be complete off in the (N+1)th. On the long term we'll be replacing
Tkenv with a Java/RCP based runtime, with much better animation
capabilities...

Upgrade to CDT 6.02: we'll be releasing the first milestone of 4.1 in the
next days, with the latest Eclipse and CDT.

Andrea Tassi

unread,
Jan 6, 2010, 4:59:49 AM1/6/10
to omn...@googlegroups.com
Hi Andras

On Wed, Jan 6, 2010 at 9:44 AM, Andras Varga <and...@omnetpp.org> wrote:
Debug problem: this is likely a CDT and/or gdb issue (we didn't touch the
CDT debugging [or editing] part, only the build process). Please post if you
find out something...

I'm using the Eclipse 3.5.1 (Build id: M20090917-0800) with CDT 6.0.2 and it's very stable in the debug process.
 
Tkenv huge font size: fonts and font sizes can be changed in the Simulation
Options dialog. Unfortunately what is the right font size in N Linux distros
will be complete off in the (N+1)th. On the long term we'll be replacing
Tkenv with a Java/RCP based runtime, with much better animation
capabilities...

Ok. I understand this problem. If I change the font size in Simulation Options dialog I still have "rendering" problems (look the attached image). Is there an environment variable that I have to change or it the version of Tk/Tcl library?
 
Upgrade to CDT 6.02: we'll be releasing the first milestone of 4.1 in the
next days, with the latest Eclipse and CDT.

Ok. I will wait for it.

Regards
Andrea
example.png

Andras Varga

unread,
Jan 6, 2010, 6:32:19 AM1/6/10
to omn...@googlegroups.com

Tkenv font size: I see, it's really ugly... To switch to another version, edit TK_CFLAGS and TK_LIBS in configure.user (or in Makefile.inc after ./configure). It may improve the situation. Another way is to edit the font settings in the source: src/tkenv/widgets.tcl, proc setupTkOptions, around line 130 (then you need to rebuild tkenv, unless you had EMBED_TCL_CODE=no in configure.user).

 

Andras

Reply all
Reply to author
Forward
0 new messages