This is the mail archive of the gdb-prs@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

gdb/371: gdb crash after 'set print object'



>Number:         371
>Category:       gdb
>Synopsis:       gdb crash after 'set print object'
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Feb 20 12:48:01 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     s.chauveau@chello.nl
>Release:        gdb 5.1
>Organization:
>Environment:
Linux Debian (unstable) 
g++ 3.0.4
>Description:

After 'set print object'  using the 'print' command  on
a class pointer crashes gdb.
>How-To-Repeat:


=== Program file test.cxx ===============

class foo {
public:
  int test ;
  int a(void) ; 
  virtual int b(void) ;
  virtual int c(void)=0 ;
} ;

class bla : public foo {
public:
  int test2 ;
  int d(void) ; 
  virtual int b(void) ;
  virtual int c(void) ;
} ;



int foo::a(void) {
  return 42 ; 
}

int foo::b(void) {
  return 42 ; 
}

int bla::b(void) {
  return 42 ; 
}

int bla::c(void) {
  return 42 ; 
}


int bla::d(void) {
  return 42 ; 
}


foo *y ;

int main(void) 
{
  foo *x = new bla ; 
  y=x ; 
  return 42 ; 
}

====== Gdb session =====================

~/src$ g++-3.0 -g test.cxx
~/src$ gdb a.out 
GNU gdb 5.1
Copyright 2001 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 "i386-linux"...
(gdb) set print object
(gdb) break main
Breakpoint 1 at 0x80487a1: file test.cxx, line 36.
(gdb) run
Starting program: /home/chauveau/src/a.out 

Breakpoint 1, main () at test.cxx:36
36        foo *x = new bla ; 
(gdb) n
37        y = x ; 
(gdb) print x
Segmentation fault
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]