|
[Sponsors] |
April 24, 2015, 10:13 |
printStack implementation
|
#1 |
Senior Member
|
Dear all,
What is the reason behind rather fancy implementation of printStack function? I.e. it first converts stack trace addresses into strings using backtrace_symbols, and then parses results of the conversion to find out converted addresses (and on OS X it needs to account for stripped file names and different format of the strings)? Internally backtrace_symbols both on Linux and Darwin uses dladdr for calculation of the contents of the strings array [1, 2]. Why not use the function directly? Please find my attempt on rewrite of the printStack.C attached to the message. File in Linux folder was tested using OpenFOAM 2.3.0 on SL 7. File in Darwin folder is adaptation of addr2Line4Mac.py idea to C (and it was born out of desire to get rid of additional Python call). It was tested on OS X 10.10.3 with clang compiler. As on Darwin atos and lldb are available, the utility used can be configured using -DUSE_ATOS or -DUSE_LLDB flags. In my tests lldb was better at address to line number conversion. Cordialement 1. https://sourceware.org/git/?p=glibc....c61c4b;hb=HEAD 2. http://www.opensource.apple.com/sour...en/backtrace.c |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Free CFD code with implementation of Menter's k-omega SST model | nikola_m | Main CFD Forum | 2 | May 8, 2020 12:13 |
Evaporation due to Heat Transport using InterFoam (Correct Implementation?) | ovie | OpenFOAM | 14 | August 3, 2019 07:00 |
a little confused with the implementation of compressibleInterFoam | su_junwei | OpenFOAM Running, Solving & CFD | 2 | May 7, 2014 17:33 |
Implementation issues of fvSchemes / laplacianScheme, in particular gaussLaplacianSch | thomek | OpenFOAM Programming & Development | 0 | October 18, 2010 05:10 |
Please explain the implementation of species transport Eqn in reactingFoam | kallipygian | OpenFOAM Running, Solving & CFD | 0 | October 13, 2008 07:29 |