|
[Sponsors] |
Recursive output of Foam::word in gdb print command |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
July 18, 2017, 20:11 |
Recursive output of Foam::word in gdb print command
|
#1 |
Member
Di Cheng
Join Date: May 2010
Location: Beijing, China
Posts: 47
Rep Power: 16 |
Hi, everyone
I am using gdb to read OpenFOAM codes and it is difficult to print fields like p and U because it contains recursively self static contained class Foam::word type and hence the gdb's print command will output things like this: Code:
(gdb) p Foam::word::null $83 = {<Foam::string> = {<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >> = "", static typeName = 0x7ffff4e38b8a "string", static debug = 0, static null = {<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >> = "", static typeName = 0x7ffff4e38b8a "string", static debug = 0, static null = <same as static member of an already seen type>}}, static typeName = 0x7ffff4e398eb "word", static debug = 0, static null = {<Foam::string> = {<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >> = "", static typeName = 0x7ffff4e38b8a "string", static debug = 0, static null = {<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >> = "", static typeName = 0x7ffff4e38b8a "string", static debug = 0, static null = <same as static member of an already seen type>}}, static typeName = 0x7ffff4e398eb "word", static debug = 0, static null = {<Foam::string> = {<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >> = "", static typeName = 0x7ffff4e38b8a "string", static debug = 0, static null = {<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >> = "", static typeName = 0x7ffff4e38b8a "string", static debug = 0, static null = <same as static member of an already seen type>}}, static typeName = 0x7ffff4e398eb "word", static debug = 0, static null = {<Foam::string> = {<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >> = "", static typeName = 0x7ffff4e38b8a "string", static debug = 0, static null = {<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >> = "", static typeName = 0x7ffff4e38b8a "string", static debug = 0, static null = <same as static member of an already seen type>}}, static typeName = 0x7ffff4e398eb "word", static debug = 0, static null = {<Foam::string> = {<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >> = "", static typeName = 0x7ffff4e38b8a "string", static debug = 0, static null = {<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >> = "", static typeName = 0x7ffff4e38b8a "string", static debug = 0, static null = <same as static member of an already seen type>}}, static typeName = 0x7ffff4e398eb "word", static debug = 0, static null = {<Foam::string> = {<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >> = "", static typeName = 0x7ffff4e38b8a "string", static debug = 0, static null = {<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >> = "", static typeName = 0x7ffff4e38b8a "string", static debug = 0, static null = <same as static member of an already seen type>}}, static typeName = 0x7ffff4e398eb "word", static debug = 0, static null = {<Foam::string> = {<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >> = "", static typeName = 0x7ffff4e38b8a "string", static debug = 0, static null = {<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >> = "", static typeName = 0x7ffff4e38b8a "string", static debug = 0, static null = <same as static member of an already seen type>}}, static typeName = 0x7ffff4e398eb "word", static debug = 0, static null = {<Foam::string> = {<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >> = "", static typeName = 0x7ffff4e38b8a "string", static debug = 0, static null = {<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >> = "", static typeName = 0x7ffff4e38b8a "string", static debug = 0, static null = <same as static member of an already seen type>}}, static typeName = 0x7ffff4e398eb "word", static debug = 0, static null = {<Foam::string> = {<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >> = "", static typeName = 0x7ffff4e38b8a "string", static debug = 0, static null = {<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >> = "", static typeName = 0x7ffff4e38b8a "string", static debug = 0, static null = <same as static member of an already seen type>}}, static typeName = 0x7ffff4e398eb "word", static debug = 0, static null = {<Foam::string> = {<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >> = "", static typeName = 0x7ffff4e38b8a "string", static debug = 0, static null = {<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >> = "", static typeName = 0x7ffff4e38b8a "string", static debug = 0, static null = <same as static member of an already seen type>}}, static typeName = 0x7ffff4e398eb "word", static debug = 0, static null = {<Foam::string> = {<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >> = "", static typeName = 0x7ffff4e38b8a "string", static debug = 0, static null = {<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >> = "", static typeName = 0x7ffff4e38b8a "string", static debug = 0, static null = <same as static member of an already seen type>}}, static typeName = 0x7ffff4e398eb "word", static debug = 0, static null = {<Foam::string> = {<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >> = "", static typeName = 0x7ffff4e38b8a "string", static debug = 0, static null = {<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >> = "", static typeName = 0x7ffff4e38b8a "string", static debug = 0, static null = <same as static member of an already seen type>}}, static typeName = 0x7ffff4e398eb "word", static debug = 0, static null = {<Foam::string> = {<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >> = "", static typeName = 0x7ffff4e38b8a "string", static debug = 0, static null = {<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >> = "", static typeName = 0x7ffff4e38b8a "string", static debug = 0, static null = <same as static member of an already seen type>}}, static typeName = 0x7ffff4e398eb "word", static debug = 0, static null = {<Foam::string> = {<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >> = "", static typeName = 0x7ffff4e38b8a "string", static debug = 0, static null = {<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >> = "", static typeName = 0x7ffff4e38b8a "string", static debug = 0, static null = <same as static member of an already seen type>}}, static typeName = 0x7ffff4e398eb "word", static debug = 0, static null = {<Foam::string> = {<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >> = "", static typeName = 0x7ffff4e38b8a "string", static debug = 0, static null = {<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >> = "", static typeName = 0x7ffff4e38b8a "string", static debug = 0, static null = <same as static member of an already seen type>}}, static typeName = 0x7ffff4e398eb "word", static debug = 0, static null = {<Foam::string> = {<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >> = "", static typeName = 0x7ffff4e38b8a "string", static debug = 0, static null = {<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >> = "", static typeName = 0x7ffff4e38b8a "string", static debug = 0, note: Foam::word is contained in almost every Foam object, so the print command is almost useless in gdb now. I tried to search stack-overflow and this forum. I found some circumvent method to overcome this in certain cases. For example Code:
(gdb) p *p.v_@p.size_ $86 = {0, 0, 0, 0, 0, 0, 0, 0, 0} However, it is difficult to apply this method to U, a Foam::GeometricField vector type. |
|
July 19, 2017, 21:19 |
|
#2 |
Member
Di Cheng
Join Date: May 2010
Location: Beijing, China
Posts: 47
Rep Power: 16 |
As the answer in stackoverflow: https://stackoverflow.com/a/45184261/4592964
set print static-members off is a good choice |
|
Tags |
gdb, openfoam |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Working directory via command line | Luiz | CFX | 4 | March 6, 2011 21:02 |
Problems of running the parallel computations | lorraine | FLUENT | 17 | July 6, 2007 09:08 |
Job Scheduler for parallel processing | kumar2 | OpenFOAM Running, Solving & CFD | 10 | March 8, 2006 07:09 |
Output from the Monitor point command | swapnil | CFX | 0 | November 20, 2002 23:08 |
command to output run information? | x. yan | Siemens | 2 | October 17, 2001 02:56 |