This is the mail archive of the
gdb-prs@sourceware.org
mailing list for the GDB project.
[Bug exp/9683] New: 'ptype aClass()' crashes when inside a method of aClass
- From: "pedro at codesourcery dot com" <sourceware-bugzilla at sourceware dot org>
- To: gdb-prs at sourceware dot org
- Date: 24 Dec 2008 16:20:32 -0000
- Subject: [Bug exp/9683] New: 'ptype aClass()' crashes when inside a method of aClass
- Reply-to: sourceware-bugzilla at sourceware dot org
While reproducing PR 9376, I noticed this GDB crash:
gcc version 4.2.4 (Ubuntu 4.2.4-1ubuntu3), x86_64 GNU/Linux
GNU gdb (GDB) 6.8.50.20081224-cvs
$ cat 1783.cc
#include <stdlib.h>
#include <stdio.h>
class Sthread
{
public:
int x ;
int y ;
Sthread() { printf ("Nice sthread\n") ;}
~Sthread() ;
void test_sthread (void) ;
};
void Sthread::test_sthread (void)
{
int i ;
i = 10 ;
i++ ;
printf ("Value of I = %d\n", i) ;
}
int main ()
{
class Sthread *newThr ;
printf ("This code tests gdb type printing \n") ;
newThr = new Sthread() ;
newThr->test_sthread() ;
return 0 ;
}
$ g++ 1783.cc -o 1783 -g3 -O0
>gdb --args ./gdb /home/pedro/1783
(top-gdb) r
Starting program: /home/pedro/gdb/baseline/build/gdb/gdb /home/pedro/1783
GNU gdb (GDB) 6.8.50.20081224-cvs
This GDB was configured as "x86_64-unknown-linux-gnu".
(gdb) start
Temporary breakpoint 1 at 0x40073d: file 1783.cc, line 27.
Starting program: /home/pedro/1783
Temporary breakpoint 1, main () at 1783.cc:27
27 printf ("This code tests gdb type printing \n") ;
(gdb) n
This code tests gdb type printing
28 newThr = new Sthread() ;
(gdb) s
Sthread (this=0x601010) at 1783.cc:9
9 Sthread() { printf ("Nice sthread\n") ;}
(gdb) ptype Sthread()
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7f0d427366e0 (LWP 23067)]
0x00000000004da69e in value_fn_field (arg1p=0x7fff4a75bc90, f=0xbf8c10, j=0,
type=0xbf88a0, offset=0)
at ../../src/gdb/value.c:1482
1482 VALUE_ADDRESS (v) = BLOCK_START (SYMBOL_BLOCK_VALUE (sym));
(top-gdb) p *sym
$2 = {ginfo = {name = 0xbf8910 "Sthread", value = {ivalue = 0, block = 0x0,
bytes = 0x0, address = 0, chain = 0x0},
language_specific = {cplus_specific = {demangled_name = 0x0}}, language =
language_cplus, section = 0,
obj_section = 0x0}, type = 0xbf88a0, symtab = 0xc17450, domain =
STRUCT_DOMAIN, aclass = LOC_TYPEDEF,
is_argument = 0, line = 5, ops = 0x0, aux_value = 0x0, hash_next = 0xbf8d20}
(top-gdb) p SYMBOL_BLOCK_VALUE (sym)
$3 = (struct block *) 0x0
(top-gdb)
--
Summary: 'ptype aClass()' crashes when inside a method of aClass
Product: gdb
Version: 6.50
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: exp
AssignedTo: unassigned at sourceware dot org
ReportedBy: pedro at codesourcery dot com
CC: gdb-prs at sourceware dot org
http://sourceware.org/bugzilla/show_bug.cgi?id=9683
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.