Page 1 of 1

source development: running CS from a debugger

Posted: Thu Oct 11, 2012 5:22 pm
by Nicoto
Hi,

This query doesn't completely fit in this category but it is probably more relevant here than in 'usage' as it does involve an element of configuration. By the way, I think it could be a good idea to create a separate category for issues strictly related to development methodologies?

In any case, I am trying to debug a case using 'ddd', a GUI to the debugger 'gdb'. I have configured my separate 'build_debug' with '--enable-debug' and successfully generated an executable. However, after that I haven't been fully able to run CS from 'ddd'. I can load '../libexec/code_saturne/cs_solver' but I end up missing arguments to run the actual case: using the xml file or the case name don't quite seem to supply all the required information.

Is this a syntax question, i.e. knowing what arguments to supply to 'cs_solver'? Or, a procedural question: e.g. should one, instead, start a run with 'code_saturne run --case=xxx --initialize', then get the process id, then connect the debugger to that id?

If this is something you use, could you please spell out the steps that you go through in order to debug a specific case through a debugger interface? (And/or advise on the syntax.)

Many thanks,

Nicolas

Re: source development: running CS from a debugger

Posted: Thu Oct 11, 2012 5:25 pm
by Nicoto
PS: I forgot to add that I did see that there were special procedures for 'valgrind' but did not see equivalents for 'gdb'.

Re: source development: running CS from a debugger

Posted: Thu Oct 11, 2012 7:04 pm
by Jacques Fontaine
Hello,

Step 1 :
Run the command:
code_saturne create -c CASE_NAME --initialize

Step 2 :
cd RESU/CASE_NAME

Step 3:
You must edit the runcase python script and replace the command
cs_solver -p file.xml
by
ddd cs_solver -x cmd

Step 4:
Write in the cmd file:
b main
run -p file.xml
b bug_function:line


This should work.
Regards