eclipse not able to find source files and breakpoints while running gdb

530 views
Skip to first unread message

AS RAJ

unread,
Apr 5, 2016, 11:59:10 PM4/5/16
to ns-3-users
Hi, 
I am trying to develop a new module in ns3. I am using eclipse IDE and have compiled debugged ns3 code in eclipse before. But now after adding the new module and trying to debug the ns-3 code , eclipse does not stop at breakpoints markedin my new module. It is not able to find source files for functions of new module and also for some core modules of ns3. At the same time it is able to find source files for wifi module. I am totally puzzled. Can any body give me solution as to how can i link source files to gdb in eclipse ? also as it can not find source files , i am not able to do step by step debugging. 
The scenario is as follows
1.  i have installed ns-3 in /home/MyUser/ns-allinone-3.22/ns-3.22
2. i have done ./waf -d debug configure --disable-examples --disable-python
3. installed eclipse and added the new project ns-3-dev with path given above. 
4. configured debug cofinguration with LD_LIBRARY_PATH  as {Workspace_loc:/ns-3-dev}/build

i have tried many things but no solution. Screen shot of debug configuration, source files and error i have attached. As you can see gdb can locate the source for yans-wifi-phy but can not locate source file for the new module or even Packet:: and Header:: modules as shown in the image. 



screenshot1.xcf
screenshot3.xcf
screenshot 4.xcf
screenshot 5.xcf

Jack Higgins

unread,
Apr 6, 2016, 1:35:34 AM4/6/16
to ns-3-users

Dear Ajinkya,

Follow the instructions in the link https://www.youtube.com/watch?v=woV7BIrEnRg . (Maybe you already did)
The video shows instructions to set eclipse in a little outdated version of ns-3 but still works the same.

Also check your wscript file in the root directory and your module directory make sure your "new module is visible" . Most of the time, the problems related to not "seeing " new modules are usually related to not setting the  wscript correctly.

Lastly, try posting pictures with "standard picture formats" .... try png  , jpeg.

Best Regards,

Jack

Ajinkya Rajandekar

unread,
Apr 7, 2016, 5:38:56 AM4/7/16
to ns-3-users
Thanks Jack.  I had already followed the procedure and wscript files were also updated. 
When i configured it using 
./waf -d debug configure 
and then used 
./waf build 
it worked. 
Previously i was using 
CXXFLAGS="-std=c++0x" ./waf -d debug configure .  
I guess the waf has limited support for C++11. when files were configured using C++11 they were missing the debugging symbols. 
When i remove this flag along with C++11 specific code from my module it worked like awesome. 
Does someone else have similar exprience?

Ajinkya

Tommaso Pecorella

unread,
Apr 7, 2016, 12:54:06 PM4/7/16
to ns-3-users
Hi,

the C++11 support shouldn't have consequences in the debugging symbols.
Without further data (compiler, OS, etc.) and/or a way to replicate the problem, we can't say more.

Anyway, we'll introduce some C++ 11 support in the future, so we're interested in this kind of problems.

Cheers,

T.

Jack Higgins

unread,
Apr 8, 2016, 1:52:30 AM4/8/16
to ns-3-users

Just a small addition ,  why use the flag "-std=c++0x" ?, As far as I know that is only for older compiler versions

I use  CXXFLAGS="-std=c++11" ./waf -d debug configure with no problems. (tested on  ns-3 3.24.1)

Ajinkya Rajandekar

unread,
Apr 8, 2016, 7:05:40 AM4/8/16
to ns-3-users
Thanks Everyone.
@Tommaso I tested it again by configuring with the c++11 flag and C++0x flag. and both times the gdb could not find the debugging symbols. 
Regarding the scenario i am using 
NS-3 3.22 with 
ubuntu 14.04 64 bit.  
compiler g++ 4.8.4.  
Eclipse version - Eclipse IDE for C/C++ Developers 4.5
gdb 7.7.1

Now tried with latest version  of ns-3 today. Followed the eclipse configuration tutorial step by step from the beginning including new workspace and hg clone ..ns-3-dev.  and tried to configure build and then run first.cc from tutorial. 
 Still can not find debugging symbols with C++11 flags. not just in eclipse even on command line when i try --command-template="gdb %s " while running first.cc of tutorial , it says no debugging symbols found. When i reconfigure it with no C++11 then finds the debugging symbols. may be some problem with my OS/compiler/gdb combination, anything to do with 64 bit os??.  By the way thanks for quick replies Jack. 

Best Regards
Ajinkya

Jack Higgins

unread,
Apr 13, 2016, 11:52:33 PM4/13/16
to ns-3-users

Sam Karr

unread,
Mar 14, 2018, 9:33:49 AM3/14/18
to ns-3-users
Hi,

This problem is still there in ns-3.27. gdb saying "no symbols found" with  CXXFLAGS="-std=c++11" or CXXFLAGS="-std=c++0x". Has anyone found a workaround for this?
Reply all
Reply to author
Forward
0 new messages