public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "mnalis-sourceware at voyager dot hr" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug gdb/16016] ptype incorrectly shows "record" (pascal/struct) as class (if accessed via pointer) (7.6.1 regression)
Date: Thu, 20 Aug 2020 22:22:14 +0000	[thread overview]
Message-ID: <bug-16016-4717-IGf5DiabPY@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-16016-4717@http.sourceware.org/bugzilla/>

https://sourceware.org/bugzilla/show_bug.cgi?id=16016

mnalis-sourceware at voyager dot hr changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mnalis-sourceware at voyager dot h
                   |                            |r

--- Comment #5 from mnalis-sourceware at voyager dot hr ---
I can confirm this is still present in gdb 8.2.1-2+b3 in Debian Buster. (when
using fpc 3.0.4+dfsg-22)

As a workaround, one has to manually typecast, for example:

        (gdb) p tempplan^[curplan].cache
        Type PLANARRAY is not a structure or union type.

        (gdb) ptype tempplan^[curplan]
        type = PLANETTYPE = class
          public
            SYSTEM : BYTE;
            CACHE : array [1..7] of WORD;
            AGE : LONGINT;
        end

        (gdb) p PLANETTYPE(tempplan^[curplan]).cache
        $42 = {5000, 5100, 5140, 0, 5040, 0, 5020}


(Note: PLANETTYPE is actually a RECORD, not CLASS):

type planettype=
  record
   system: byte;
   cache: array[1..7] of word;
   age: longint;
  end;
 planarray= array[1..1000] of planettype;
var tempplan: ^planarray;

-- 
You are receiving this mail because:
You are on the CC list for the bug.

  parent reply	other threads:[~2020-08-20 22:22 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-08 10:49 [Bug gdb/16016] New: " gdb.bugs at mfriebe dot de
2013-10-17 20:10 ` [Bug gdb/16016] " sergiodj at redhat dot com
2014-09-12 23:12 ` sergiodj at redhat dot com
2015-01-06  1:35 ` gdb.bugs at mfriebe dot de
2015-08-31 10:08 ` gdb.bugs at mfriebe dot de
2020-08-20 22:22 ` mnalis-sourceware at voyager dot hr [this message]
2020-08-21 20:31 ` [Bug pascal/16016] " tromey at sourceware dot org
2020-08-24 15:45 ` muller 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-16016-4717-IGf5DiabPY@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).