From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id BF6DE3858407; Wed, 10 Nov 2021 16:52:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BF6DE3858407 From: "blarsen at redhat dot com" To: gdb-prs@sourceware.org Subject: [Bug c++/26550] Object of class with virtual base classes printed incorrectly (gdb.cp/ambiguous.exp) Date: Wed, 10 Nov 2021 16:52:08 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: c++ X-Bugzilla-Version: unknown X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: blarsen at redhat dot com X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gdb-prs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-prs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Nov 2021 16:52:08 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D26550 B. Larsen changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |blarsen at redhat dot com --- Comment #2 from B. Larsen --- Hi! I've stated looking at this bug, and I have a new insight > And with the following we see how GDB is clearly confusing the offset of = _vptr.KV > with the offset of A1: > (gdb) print /x jva1 > $1 =3D { =3D { =3D {x =3D 0x2, y =3D 0x16}, _vptr.KV =3D 0x555555= 557b88 JVA1+24>, i =3D 0x457}, ......} > ^^^^^^^^^^^^^^ > (gdb) print /x jva1.KV::x > $2 =3D 0x55557b88 > ^^^^^^^^^^ > (gdb) print /x jva1.KV::y > $3 =3D 0x5555 I think the problem runs a little deeper because of the following tests: (gdb) print &jva1.KV::x $1 =3D (int *) 0x7fffffffe0f0 (gdb) print &jva1.LV::x $2 =3D (int *) 0x7fffffffe100 (gdb) p &jva1 $3 =3D (JVA1 *) 0x7fffffffe0f0 and if I understand virtual inheritance correctly (and dissassembly of the code), $1 and $2 should be the same, both 0x7f...fe100 --=20 You are receiving this mail because: You are on the CC list for the bug.=