This is the mail archive of the
gdb-prs@sources.redhat.com
mailing list for the GDB project.
Re: c++/1069: Issues printing derived objects with gdb
- From: Daniel Jacobowitz <drow at mvista dot com>
- To: nobody at sources dot redhat dot com
- Cc: gdb-prs at sources dot redhat dot com,
- Date: 19 Feb 2003 16:38:00 -0000
- Subject: Re: c++/1069: Issues printing derived objects with gdb
- Reply-to: Daniel Jacobowitz <drow at mvista dot com>
The following reply was made to PR c++/1069; it has been noted by GNATS.
From: Daniel Jacobowitz <drow at mvista dot com>
To: monte at juniper dot net
Cc: gdb-gnats at sources dot redhat dot com
Subject: Re: c++/1069: Issues printing derived objects with gdb
Date: Wed, 19 Feb 2003 11:34:52 -0500
On Wed, Feb 19, 2003 at 04:19:56PM -0000, monte at juniper dot net wrote:
>
> >Number: 1069
> >Category: c++
> >Synopsis: Issues printing derived objects with gdb
> >Confidential: no
> >Severity: serious
> >Priority: medium
> >Responsible: unassigned
> >State: open
> >Class: change-request
> >Submitter-Id: net
> >Arrival-Date: Wed Feb 19 16:28:00 UTC 2003
> >Closed-Date:
> >Last-Modified:
> >Originator: Monte Becker
> >Release: GDB 5.3, GCC 2.95.3
> >Organization:
> >Environment:
> (gdb) show version
> GNU gdb 5.3
> 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 "sparc-sun-solaris2.8".
>
> monte-cristo > gcc -v
> Reading specs from /usr/local/lib/gcc-lib/sparc-sun-solaris2.8/2.95.3/specs
> gcc version 2.95.3 20010315 (release)
> >Description:
> Try as I might, I can't look at the contents of a derived
> object. The object in question has some static members.
> For example:
>
> ...AHHHH...
>
> It worked the second time. OK, here's the first time:
>
> (gdb) p RV0_3
> $1 = {<random_variable> = {static m_default_seed = Internal: global symbol `_15random_variable.m_default_seed' found in /net/cristo/ldisk/work/monte/sand/tga_top/tga/cv_verif/c_shared_tb/random_variable.C psymtab but not in symtab.
> _15random_variable.m_default_seed may be an inlined function, or may be a template function
> (if a template, try specifying an instantiation: _15random_variable.m_default_seed<type>).
>
> And here's the second time:
>
> (gdb) whatis RV0_3
> type = uniform_rv
> (gdb) p RV0_3
> $2 = {<random_variable> = {static m_default_seed = 0x6,
> _vptr. = 0x61a50 <uniform_rv virtual table>}, m_min = 0x0, m_max = 0x3,
> mt = {0x995147ee, 0xddfb0c04, 0x8fbe12, 0xd9e031f0, 0xc140f856, 0x6b1316dc,
> ....(The stuff I would expect)
I've seen this one before. I think we know where it comes from now...
> Then I tried to print the result of a method:
>
> (gdb) p RV0_3.gen()
>
> Breakpoint 2, filebuf::filebuf ()
> at /net/cristo/ldisk/work/monte/sand/tga_top/tga/cv_verif/c_dram_tb/TgaDRamTest_Rand.C:105
> The program being debugged stopped while in a function called from GDB.
> When the function (uniform_rv::gen(void)) is done executing, GDB will silently
> stop (instead of continuing to evaluate the expression containing
> the function call).
>
> There are no breaks inside of this object.
Are you sure? Do you have a break at filebuf::filebuf, and what's the
backtrace look like when GDB claims you've hit it?
> >How-To-Repeat:
>
> (Will construct test case if needed. Let me know.)
It always helps if you can do this.
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer