This is the mail archive of the
gdb-prs@sourceware.org
mailing list for the GDB project.
[Bug mi/13041] Virtual base class botch
- From: "dj170590 at hotmail dot com" <sourceware-bugzilla at sourceware dot org>
- To: gdb-prs at sourceware dot org
- Date: Thu, 4 Aug 2011 10:42:32 +0000
- Subject: [Bug mi/13041] Virtual base class botch
- Auto-submitted: auto-generated
- References: <bug-13041-4717@http.sourceware.org/bugzilla/>
http://sourceware.org/bugzilla/show_bug.cgi?id=13041
--- Comment #3 from Dennis <dj170590 at hotmail dot com> 2011-08-04 10:42:02 UTC ---
Error isn't fixed in GDB 7.3 as far as I still get the error now. I'll try to
explain what the real problem is but a example is hard to make, because I use a
wrapper around the GDB commands that are used, and the wrapper isn't made by
me.. So I cannot exactly see what the commands are that are send to GDB MI.
Only if it fails.
Example code:
#include <iostream>
using namespace std;
using namespace sc_core;
class sc_module
{
public:
sc_module()
{
sc_module_init();
}
void
sc_module_init()
{
int a = 0;
a++;
a += 4;
}
};
class sc_interface{};
class tlm_bw_nonblocking_transport_if : public virtual sc_interface{};
class tlm_bw_direct_mem_if : public virtual sc_interface{};
class tlm_bw_transport_if: public virtual tlm_bw_nonblocking_transport_if,
public virtual tlm_bw_direct_mem_if{};
class CPU: public tlm_bw_transport_if, public sc_module
{
public:
CPU(){}
virtual ~CPU(){} //Destructor
};
class tlm_fw_nonblocking_transport_if : public virtual sc_interface {};
class tlm_blocking_transport_if : public virtual sc_interface {};
class tlm_fw_direct_mem_if : public virtual sc_interface{};
class tlm_transport_dbg_if : public virtual sc_interface{};
class tlm_fw_transport_if
: public virtual tlm_fw_nonblocking_transport_if
, public virtual tlm_blocking_transport_if
, public virtual tlm_fw_direct_mem_if
, public virtual tlm_transport_dbg_if
{};
class RAM: public sc_module, public tlm_fw_transport_if
{
public:
RAM(){}
virtual ~RAM(){} //Destructor
};
class Top: public sc_module
{
public:
Top(){};
CPU cpu;
RAM ram;
};
int main( int argc , char **argv )
{
Top top();
cout << "Done" << endl;
return 0;
}
I run:
gdb -n -readnow --interpreter=mi --args ../../Example
-break-insert sc_module::sc_module_init
If it's hit the first time, cpu is made, that's no problem.
But second time it hits ram is made, then I get a virtual base class botch.
What I do when sc_module_init is hit for the second time(so ram is made):
I go up the stacklevel so I am in main.
Then I create the var named var24 and I go look what the childs of it are if i
check var24.public.ram.tlm::tlm_fw_transport_if<tlm::tlm_base_protocol_types>
with the command "-var-list-children --all-values
\"var24.public.ram.tlm::tlm_fw_transport_if<tlm::tlm_base_protocol_types>\""
I get the error.
I hope the problem is more clear now.
Ask if it isn't, please.
--
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.