public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "dj170590 at hotmail dot com" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug mi/13041] Virtual base class botch
Date: Thu, 04 Aug 2011 10:42:00 -0000	[thread overview]
Message-ID: <bug-13041-4717-HW7DfCJce5@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <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.


  parent reply	other threads:[~2011-08-04 10:42 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-29  8:11 [Bug mi/13041] New: " dj170590 at hotmail dot com
2011-08-03 20:37 ` [Bug mi/13041] " tromey at redhat dot com
2011-08-04  9:47 ` pedro at codesourcery dot com
2011-08-04  9:48 ` pedro at codesourcery dot com
2011-08-04 10:42 ` dj170590 at hotmail dot com [this message]
2011-08-04 14:10 ` pedro at codesourcery dot com
2011-08-04 15:04 ` dj170590 at hotmail dot com
2011-08-04 15:30 ` dj170590 at hotmail dot com
2011-08-04 15:56 ` pedro at codesourcery dot com
2012-12-19 21:56 ` tromey at redhat dot com
2012-12-19 21:58 ` tromey at redhat dot com
2022-08-10 17:09 ` [Bug c++/13041] " tromey at sourceware dot org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-13041-4717-HW7DfCJce5@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=gdb-prs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).