Personal tools
You are here: Home Forum How to use Salome? How to the debug new components with SALOME

How to the debug new components with SALOME

Up to How to use Salome?

How to the debug new components with SALOME

Posted by Yuefeng Qiu at January 17. 2013

Hello!

I am developing a new c++ component (with CORBA ) and integrating into the SALOME. My trouble is I cannot find any solution to debug the SALOME together with my new component, instead I have to install it every time and run the SALOME to see what happens. it is really time consuming to find bug every time. 

Is there any solution to debug the component with SALOME? 

I am currently working under Linux system, and developing the code with  QtCreator . It would be nice if I can debug under QtCreator IDE, but any other possible way are also welcome.

Thanks !

 

Re: How to the debug new components with SALOME

Posted by Vadim SANDLER at January 17. 2013

Hello,

It is not clear why you cannot debug your component within SALOME - I do not see any problems with it.

My only guess is that you try to attach debugger to SALOME too early. Indeed, SALOME loads component libraries to the memory only on explicit user action (when you activate a module in GUI, for example), i.e. dynamically. In such a case, debugger cannot load symbols of the component libraries properly.

To overcome this problem, you have to run SALOME and activate module first, and only then attach debugger to SALOME - you'll need SALOME_Session_Server process, for example:

[%] runSalome

- activate your module from menu, then

[%] ps -ef | grep SALOME_Session_Server

- get pid and attach gdb to it:

[%] gdb
[-gdb-] attach <pid>

Regards,
Vadim.

Previously Yuefeng Qiu wrote:

Hello!

I am developing a new c++ component (with CORBA ) and integrating into the SALOME. My trouble is I cannot find any solution to debug the SALOME together with my new component, instead I have to install it every time and run the SALOME to see what happens. it is really time consuming to find bug every time. 

Is there any solution to debug the component with SALOME? 

I am currently working under Linux system, and developing the code with  QtCreator . It would be nice if I can debug under QtCreator IDE, but any other possible way are also welcome.

Thanks !

 

 

Re: How to the debug new components with SALOME

Posted by Yuefeng Qiu at January 18. 2013

Thank, Vadim!

I've read your reply carefully and now I can handle with GDB already. 

Actually, I was stuck on a problem of calling a method in the Engine. when calling a method used the Engine, I receive an Unknow Exception. when I debug my component with gdb, I discovered that my lib***Engine.so is not load by SALOME server, others like  lib***.so and lib***IDL.so is load properly. 

I thought lib***Engine.so will be load by SALOME by default. Are there any reasons will cause the failure of loading this library?

I attach the source code. the problem is happen in the OnUnitTest() slot of XYZMESHGUI.cxx.

should I start a new conversation?

 

 

 

Attachments

Re: How to the debug new components with SALOME

Posted by Yuefeng Qiu at January 18. 2013

I think I found the reason why the lib***Engine.so was not loaded. In the method XYZMESHGUI::InitXYZMESHGen() I believe it fails to load the component with the SALOME CORBA. Perhaps there is a bug. 

This code is for practice, my purpose is just to let it run normally in SALOME. But it will be important experience for me. 

 

Regards,

Qiu

Re: How to the debug new components with SALOME

Posted by Vadim SANDLER at January 18. 2013

Hello Qiu,

I compiled the source code you attached. After some minor modifications I have succeded to load XYZMESH module in SALOME and attach the debugger. All libraries were loaded including libXYZMESHEngine.so.

However, I was able to do this only after I renamed INSTALL/XYZMESH/share/salome/resources/XYZMESH directory to INSTALL/XYZMESH/share/salome/resources/xyzmesh. Otherwise XYZMESH module was ignored by SALOME.

This is because SALOME requires ( please, do not ask me why :) ) that last component in the module resources directory path must be module name in lowercase. To do this correctly, you have to change in configure.ac:

MODULE_NAME=XYZMESH

to

MODULE_NAME=xyzmesh

I don't know if this the same problem you had but you can try this and see what happens.

Regards,
Vadim.

Previously Yuefeng Qiu wrote:

I think I found the reason why the lib***Engine.so was not loaded. In the method XYZMESHGUI::InitXYZMESHGen() I believe it fails to load the component with the SALOME CORBA. Perhaps there is a bug. 

This code is for practice, my purpose is just to let it run normally in SALOME. But it will be important experience for me. 

 

Regards,

Qiu

 

Re: How to the debug new components with SALOME

Posted by Yuefeng Qiu at January 21. 2013

Hello, Vadim!

It is so great to see your reply in this Monday morning! You bring new hope for me!

I follow your advice and it works for me, at least the code can enter the methods in the Engine. 

Thanks a lot! 

Best regards,

Yuefeng

Powered by Ploneboard
Document Actions