This is the mail archive of the
gdb-prs@sourceware.org
mailing list for the GDB project.
[Bug mi/13041] New: Virtual base class botch
- From: "dj170590 at hotmail dot com" <sourceware-bugzilla at sourceware dot org>
- To: gdb-prs at sourceware dot org
- Date: Fri, 29 Jul 2011 08:11:06 +0000
- Subject: [Bug mi/13041] New: Virtual base class botch
- Auto-submitted: auto-generated
http://sourceware.org/bugzilla/show_bug.cgi?id=13041
Summary: Virtual base class botch
Product: gdb
Version: 7.2
Status: NEW
Severity: normal
Priority: P2
Component: mi
AssignedTo: unassigned@sourceware.org
ReportedBy: dj170590@hotmail.com
Hello,
First of all I'd like to say I do use a library (SystemC and TLM)and alot of
classes in it use virtual inherintance. So I cannot ignore the virtual
inheritance. My program uses GDB MI and it really depends on SystemC/TLM so I
can hardly make a program which can construct the realy problem, but i try to
explain the bug I think it is.
When I do use "-var-list-children --all-values VARNAME" on a var where VARNAME
is of an object derived from 2 class in a particular order everything goes
ok(like Example01), but when a switch them I get a virtual base class botch so
I think it's a bug?
Example 01 Everything is ok:
class CPU: public tlm_bw_transport_if<>, public sc_module
{
public:
tlm_initiator_socket<> socket;
SC_CTOR(CPU): //constructor
socket("CPUSocketNAME")
{
socket.bind(*this);
}
virtual ~CPU(){} //Destructor
//.......
//....... etc
};
tlm_bw_transport_if is out of the TLM source and this class is declared as:
template <typename TYPES = tlm_base_protocol_types>
class tlm_bw_transport_if
: public virtual tlm_bw_nonblocking_transport_if<typename
TYPES::tlm_payload_type,
typename
TYPES::tlm_phase_type>
, public virtual tlm_bw_direct_mem_if
{};
And those base classes are inherited from some other virtual base classes etc.
With this example it goed wrong:
class CPU: public sc_module, public tlm_bw_transport_if<>
{
public:
tlm_initiator_socket<> socket;
SC_CTOR(CPU): //constructor
socket("CPUSocketNAME")
{
socket.bind(*this);
}
virtual ~CPU(){} //Destructor
//.......
//....... etc
};
void main()
{
CPU cpu01("myCPU");
}
The think my program does is setting a breakpoint in the sc_module constructor
So that's the point my program stays when I do try to get the varname where the
CPU object is stored in(that's cpu01). When I do have it, I use the command
"-var-list-children --all-values VARNAME" to get all the base classes of CPU
object cpu. But when i try this in the first example everything is OK and I can
get the base classes of tlm_bw_transport_if<>, but when I use the GDB MI
command with example 2 on the variabele it sais "virtual base class botch"
var01 is a gdb variabele on cpu01.
the gdb command I use, is like "-var-list-children --all-values
var01.tlm::tlm_fw_transport_if<tlm::tlm_base_protocol_types>"
I hope I am clear about the problem and you can understand the problem. Sorry
if my english or explaination is a bit bad.
--
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.