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] New: Virtual base class botch
Date: Fri, 29 Jul 2011 08:11:00 -0000	[thread overview]
Message-ID: <bug-13041-4717@http.sourceware.org/bugzilla/> (raw)

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.


             reply	other threads:[~2011-07-29  8:11 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-29  8:11 dj170590 at hotmail dot com [this message]
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
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@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).