[Developers] debugging issues; -g is now useless with gdb
John Sibert
sibert at hawaii.edu
Sun Feb 23 12:21:07 PST 2014
Good point. There is not performance penalty to the debug info, and you
can always reduce the fat with strip.
John Sibert
Emeritus Researcher, SOEST
University of Hawaii at Manoa
Honolulu HI (GMT-10)
808-294-3842
Visit the ADMB project http://admb-project.org/
On 02/22/2014 04:39 PM, dave fournier wrote:
> On 14-02-22 06:21 PM, John Sibert wrote:
>> Starting with gcc-4.8 (or perhaps gcc-4.7) the compiler does not
>> generate debugging information that is completely compatible with
>> gdb. As a result the message "No symbol 'foo' in current context." is
>> emitted every time an attempt is made to print or display a variable.
>> Searching on the message yields a lot of useless advice about
>> suppressing optimization. While is this advice is more or less
>> correct, it does not eliminate the message or permit examining a
>> variable. After a lot of further searching on stackoverflow, the
>> solution is apparently to replace -g or -ggdb with "-g -gdwarf-2".
>> Further farting around will reveal whether both -g and -gdwarf-2 are
>> necessary. (Reverting to gcc-4.6.3 also solves the problem, but seems
>> dumb.)
>>
>> The ADMB make scripts for gcc use -ggdb and will not produce the
>> desired result.
>>
>> Also, IMHO, there is no point in compiling with both the OPT_LIB
>> macro and the debug flags. It won't tell you where you walked out of
>> an array in the optimized libraries. If you want to debug something
>> use the safe libraries.
>>
>> John
>>
> Thanks for that info. I had experienced that problem, but not woken up
> to tryiong to deal with it yet.
>
> As to OPT_LIB and debugging, it is still useful when you want the
> model to run more quickly, and the problem is not walking out
> of an array, but rather say some kind of arithmetic exception.
>
> Dave
> _______________________________________________
> Developers mailing list
> Developers at admb-project.org
> http://lists.admb-project.org/mailman/listinfo/developers
>
More information about the Developers
mailing list