This is the mail archive of the
gdb-prs@sources.redhat.com
mailing list for the GDB project.
gdb/653: seg fault when printing virtual function with g++ -gdwarf-2
- From: carlton at math dot stanford dot edu
- To: gdb-gnats at sources dot redhat dot com
- Date: 16 Aug 2002 21:53:30 -0000
- Subject: gdb/653: seg fault when printing virtual function with g++ -gdwarf-2
- Reply-to: carlton at math dot stanford dot edu
>Number: 653
>Category: gdb
>Synopsis: seg fault when printing virtual function with g++ -gdwarf-2
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Fri Aug 16 14:58:01 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator: carlton@math.stanford.edu
>Release: current cvs
>Organization:
>Environment:
jackfruit$ uname -a
Linux jackfruit.Stanford.EDU 2.4.18-5 #1 Mon Jun 10 15:31:48 EDT 2002 i686 unknown
jackfruit$ gcc -v
Reading specs from /usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.1/specs
Configured with: ../gcc-3.1/configure --enable-languages=c++
Thread model: single
gcc version 3.1
jackfruit$ gdb -v
GNU gdb 2002-07-25-cvs
Copyright 2002 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i686-pc-linux-gnu".
>Description:
When debugging code compiled with g++ -gdwarf-2, GDB segfaults when trying to print out a virtual function member.
This seems relatively recent; it doesn't happen with the "GDB 5.2-2" that comes with RedHat 7.3 But it does with the current CVS.
>How-To-Repeat:
Compile this using g++ -gdwarf2:
class A {
public:
virtual void foo() {};
};
int main()
{
A *theA = new A;
}
Then run GDB on it, and do
(gdb) b main
Breakpoint 1 at 0x80485d0: file test-7.cc, line 15.
(gdb) r
Starting program: /home/carlton/gdb/bugs/574/test-7/a.out
Breakpoint 1, main () at test-7.cc:15
15 A *theA = new A;
(gdb) n
16 }
(gdb) p theA->foo
Segmentation fault
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: