Welcome, Guest
Username: Password: Remember me

TOPIC: Request for advice on tel model debug workflow

Request for advice on tel model debug workflow 6 years 2 months ago #31394

  • shenh
  • shenh's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 148
  • Thank you received: 37
Dear all, I am trying to debug a telemac2d model, for which I would like to setup break points and review variable values. I am using a workflow as below with debugger gdbgui:
1 compile the source code with -g flag (see attached configuration file v7p2r3)
2 run the model with the debug configuration file using python file runcode.py. Kill the model run once the time stamped run folder is created, so all custom compilation and file copy processes are completed
3 launch gdbgui and feed the executable (e.g. out_telemac.exe) to gdbgui
4 try to setup break point - I am stuck here. It keeps telling me It cannot find source file.

Could anyone kindly comment on this workflow? There should be a more elegant workflow. Could you please share your debug toolchain?

Any inputs are greatly appreciated!

Hailiang


File Attachment:

File Name: systel-debug.cfg
File Size: 1 KB


gdbgui-2018-09-07_15-30-13.png
The administrator has disabled public write access.

Request for advice on tel model debug workflow 6 years 2 months ago #31409

  • c.coulet
  • c.coulet's Avatar
  • OFFLINE
  • Moderator
  • Posts: 3722
  • Thank you received: 1031
Hi Hailiang

Never use gdbgui, just gdb on my computer...
It's not user friendly but allow to find some error.
I have the same workflow except I run gdb in the temporary directory

Regards
Christophe
The administrator has disabled public write access.
The following user(s) said Thank You: shenh, lizejin

Request for advice on tel model debug workflow 6 years 2 months ago #31410

  • shenh
  • shenh's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 148
  • Thank you received: 37
Thanks Chris. I was trying to use something more user friendly. gdbgui uses gdb under the scene but somehow did not work in this case. I do not mind to use gdb directly.

I was able to setup break points and step through the program. I am getting empty PATH (see 2018-09-10_9-42-16.pnd), which leads to an error message saying the choice of language is invalid (see 2018-09-10-9-47-07.png).

Are there any command line arguments I need to feed to the gdb run command so it can locate the the T2DCAS file? Please note if I just run out_telemac2d.exe in a cmd window, the program ran without any issue.

Thanks again for your help!

Hailiang


2018-09-10_9-42-16.png


2018-09-10_9-47-07.png
The administrator has disabled public write access.

Request for advice on tel model debug workflow 6 years 2 months ago #31411

  • c.coulet
  • c.coulet's Avatar
  • OFFLINE
  • Moderator
  • Posts: 3722
  • Thank you received: 1031
Hi

It's strange if the out_telemac2d.exe works in a cmd windows and have a problem with gdb...

I'm not a specialist of gdb but as you run it in a different place of the program there is maybe an issue here.

Maybe you could try this workflow:
In the cmd windows, move to the telemac temporary directory
Once in the temp directory, enter gdb out_telemac2d.exe
It should start gdb for this telemac case.
First try run and see what happens.

Before the first call, I think it's logical to have path empty...
Christophe
The administrator has disabled public write access.

Request for advice on tel model debug workflow 6 years 2 months ago #31413

  • shenh
  • shenh's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 148
  • Thank you received: 37
Thank your very much Chris for the speedy response! The working directory is exactly the issue. After I set the current work directory to where out_telemac2d.exe is with cd D:/Projects/IRAP2/Tests/test1-dbg/telemac/test1.cas_2018-09-06-11h17min01s once the gdb is launched, it works. I believe telemac is searching for the required files inside the working folder. Without setting the directory, gdb will fail.

For the cmd window run, I cd to the working directory before launching out_telemac2d.exe, which is why it worked.

Hailiang
The administrator has disabled public write access.

Request for advice on tel model debug workflow 6 years 2 months ago #31414

  • c.coulet
  • c.coulet's Avatar
  • OFFLINE
  • Moderator
  • Posts: 3722
  • Thank you received: 1031
Good news!

This is probably the same issue with gdbgui...
You should set the working directory somewhere in the parameter to allow telemac to works well and then debug the code

Regards
Christophe
The administrator has disabled public write access.

Request for advice on tel model debug workflow 6 years 2 months ago #31415

  • shenh
  • shenh's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 148
  • Thank you received: 37
Hi Chris, with gdbgui although I still cannot set break point by mouse clicking (as it is designed), I can setup break points through command line at the bottom with regular gdb commands. Additionally, gdbgui allows view variables much easier than gdb in my mind.

Thanks Chris for the great help,

Hailiang


2018-09-10_10-33-27.png
The administrator has disabled public write access.
Moderators: pham

The open TELEMAC-MASCARET template for Joomla!2.5, the HTML 4 version.