[Developers] debugging issues; -g is now useless with gdb

John Sibert sibert at hawaii.edu
Mon Feb 24 11:42:38 PST 2014


Interesting. Here is what I'm using to get the error:

K:~$ ddd --version
GNU DDD 3.3.12 (x86_64-pc-linux-gnu)
Copyright (C) 1995-1999 Technische Universit�t Braunschweig, Germany.
Copyright (C) 1999-2001 Universit�t Passau, Germany.
Copyright (C) 2001 Universit�t des Saarlandes, Germany.
Copyright (C) 2001-2009 Free Software Foundation, Inc.

K:~$ gdb --version
GNU gdb (Ubuntu/Linaro 7.4-2012.04-0ubuntu2.1) 7.4-2012.04
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later 
<http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
For bug reporting instructions, please see:
<http://bugs.launchpad.net/gdb-linaro/>.

K:~$ g++ --version
g++ (GCC) 4.8.0
Copyright (C) 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

K:~$ uname -a
Linux kihikihi 3.2.0-59-generic #90-Ubuntu SMP Tue Jan 7 22:43:51 UTC 
2014 x86_64 x86_64 x86_64 GNU/Linux



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/24/2014 09:13 AM, Johnoel Ancheta wrote:
> Unable to produce the no symbol error on Fedora 19 
> <http://distrowatch.com/table.php?distribution=fedora>.
>
> Seem to just work with no modifications.
>
>
> On Sun, Feb 23, 2014 at 10:22 AM, John Sibert <sibert at hawaii.edu 
> <mailto:sibert at hawaii.edu>> wrote:
>
>     Perhaps.
>
>     I have
>     $ gdb --version
>     GNU gdb (Ubuntu/Linaro 7.4-2012.04-0ubuntu2.1) 7.4-2012.04
>
>     But
>     https://www.sourceware.org/gdb/
>     announced
>     February 6th, 2014: *GDB 7.7 Released!*
>     The latest version of GDB, version 7.7, is available for download
>     <https://www.sourceware.org/gdb/download/>.
>
>
>
>     John Sibert
>     Emeritus Researcher, SOEST
>     University of Hawaii at Manoa
>     Honolulu HI (GMT-10)
>     808-294-3842 <tel:808-294-3842>
>
>     Visit the ADMB project http://admb-project.org/
>
>     On 02/22/2014 08:11 PM, Johnoel Ancheta wrote:
>
>         Does gdb just need to be updated?
>
>
>         On Sat, Feb 22, 2014 at 4:21 PM, John Sibert
>         <sibert at hawaii.edu <mailto:sibert at hawaii.edu>
>         <mailto:sibert at hawaii.edu <mailto:sibert at hawaii.edu>>> 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
>
>         -- John Sibert
>         Emeritus Researcher, SOEST
>         University of Hawaii at Manoa
>         Honolulu HI (GMT-10)
>         808-294-3842 <tel:808-294-3842> <tel:808-294-3842
>         <tel:808-294-3842>>
>
>
>         Visit the ADMB project http://admb-project.org/
>
>         _______________________________________________
>         Developers mailing list
>         Developers at admb-project.org
>         <mailto:Developers at admb-project.org>
>         <mailto:Developers at admb-project.org
>         <mailto:Developers at admb-project.org>>
>         http://lists.admb-project.org/mailman/listinfo/developers
>
>
>
>




More information about the Developers mailing list