|
[Sponsors] |
October 15, 2012, 08:15 |
how to use gdb to debug openfoam?
|
#1 |
Member
HouKen
Join Date: Jul 2011
Posts: 67
Rep Power: 15 |
HI foamers!
Since I want to implement energy equation to original interFoam solver, I started from test the interFoam by debug tool--gdb. For example, in order to read the value of rho1 and rho2, I break interFoam in gdb like: b alphaEqn.H:26 and it do stops at that point. However if I try to output the the value of rho1 by "disp rho1", or other variable, usually the result was: rho1 = (const Foam::dimensionedScalar &) @0x7fffffff8cd0: { name_ = {<Foam::string> = {<std::basic_string<char, std::char_traits<char>, std::allocator<char> >> = { static npos = <optimized out>, _M_dataplus = {<std::allocator<char>> = {<__gnu_cxx::new_allocator<char>> = {<No data fields>}, <No data fields>}, _M_p = 0x8a5048 "rho"}}, static typeName = 0x7ffff550c960 "string", static debug = 0, static null = {<std::basic_string<char, std::char_traits<char>, std::allocator<char> >> = { static npos = <optimized out>, _M_dataplus = {<std::allocator<char>> = {<__gnu_cxx::new_allocator<char>> = {<No data fields>}, <No data fields>}, _M_p = 0x7ffff4d784d8 ""}}, static typeName = 0x7ffff550c960 "string", static debug = 0, static null = <same as static member of an already seen type>}}, static typeName = 0x7ffff550cb92 "word", static debug = 2, static null = {<Foam::string> = {<std::basic_string<char, std::char_traits<char>, std::allocator<char> >> = {static npos = <optimized out>, .................. and it seems it's endless and I am totally confused both because I can't find the value of rho1 also I don't understand what these output I got means. Can someone help? Thanks in advance! |
|
October 15, 2012, 11:08 |
|
#2 |
Member
Meindert de Groot
Join Date: Jun 2012
Location: Netherlands
Posts: 34
Rep Power: 14 |
Try
p rho1.v_ You may find it useful to look into gdbOF (http://openfoamwiki.net/index.php/Contrib_gdbOF) aswell. |
|
October 16, 2012, 03:05 |
|
#3 | |
Member
HouKen
Join Date: Jul 2011
Posts: 67
Rep Power: 15 |
Quote:
I think I need to learn more c++ before debugging source code ... |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
OpenFOAM 1.5.x package - CentOS 5.3 x86_64 | linnemann | OpenFOAM Installation | 7 | July 30, 2009 04:14 |
Summer School on Numerical Modelling and OpenFOAM | hjasak | OpenFOAM | 5 | October 12, 2008 14:14 |
64bitrhel5 OF installation instructions | mirko | OpenFOAM Installation | 2 | August 12, 2008 19:07 |
OpenFOAM Debian packaging current status problems and TODOs | oseen | OpenFOAM Installation | 9 | August 26, 2007 14:50 |
OpenFOAM Training and Workshop Zagreb 2628Jan2006 | hjasak | OpenFOAM | 1 | February 2, 2006 22:07 |