Dwarves Archive on lore.kernel.org
 help / color / Atom feed
From: Mark Wielaard <mjw-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
To: Nicolas <nikos42-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: dwarves-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: Brain fart alert
Date: Tue, 26 Feb 2013 11:56:03 +0100
Message-ID: <1361876163.4930.4.camel@bordewijk.wildebeest.org> (raw)
In-Reply-To: <CACHCVZ6uvDW1CpyxXio3P17EL6bE=FKGDNm11RNZTceR-dWLjg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

On Tue, 2013-02-26 at 02:50 +0100, Nicolas wrote:
> Hello,
> 
> Just pinging the list, about the alert triggered by the example in my
> last email (brainfart2.cpp).

The issue is:

 [    69]    class_type
             name                 (string) "C"
             byte_size            (data1) 8
             decl_file            (data1) 1
             decl_line            (data1) 11
             containing_type      (ref4) [    69]
             sibling              (ref4) [    aa]
 [    77]      inheritance
               type                 (ref4) [    57]
               data_member_location (sdata) 0
               accessibility        (data1) public (1)
 [    7e]      member
               name                 (strp) "_vptr.C"
               type                 (ref4) [    bc]
               data_member_location (sdata) 0
               artificial           (flag) Yes

class__fprintf sees the inheritance and member at the same
data_member_location and skips the member (which contains the real
size).

You could work around it with the following patch:

diff --git a/dwarves_fprintf.c b/dwarves_fprintf.c
index 23da5b1..90d830a 100644
--- a/dwarves_fprintf.c
+++ b/dwarves_fprintf.c
@@ -1386,8 +1386,7 @@ size_t class__fprintf(struct class *class, const
struct cu
                ++printed;
 
                /* XXX for now just skip these */
-               if (tag_pos->tag == DW_TAG_inheritance &&
-                   pos->virtuality == DW_VIRTUALITY_virtual)
+               if (tag_pos->tag == DW_TAG_inheritance)
                        continue;
 
                /*

Just ignoring the virtuality. But I don't really understand the special
casing and sizing issues around inheritance. So why this works is a
mystery to me atm.

Cheers,

Mark

--
To unsubscribe from this list: send the line "unsubscribe dwarves" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply index

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-21 18:22 Nicolas
     [not found] ` <CACHCVZ6oDyFwGbC4EwF_wsR9tCkoych5N6buLhRRLcyaL6iifw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-08-15 17:56   ` Arnaldo Carvalho de Melo
     [not found]     ` <20120815175647.GK2370-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
2012-08-16 19:52       ` Arnaldo Carvalho de Melo
     [not found]         ` <20120816195224.GC10277-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
2012-08-19 22:16           ` Mark Wielaard
2012-08-20 13:45         ` Dodji Seketeli
     [not found]           ` <m3obm5fzhs.fsf-fIDRvF7C5exg9hUCZPvPmw@public.gmane.org>
2012-08-20 17:35             ` Arnaldo Carvalho de Melo
2012-08-20 18:02   ` Arnaldo Carvalho de Melo
     [not found]     ` <20120820180216.GE3046-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
2012-08-20 18:28       ` Arnaldo Carvalho de Melo
2012-08-30 16:35       ` Nicolas
     [not found]         ` <CACHCVZ5EJadxOTJ0T4phSfAcm1FK7wfeDTp9QcSa1V1JCpa8SA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-09-03 12:22           ` Mark Wielaard
     [not found]             ` <1346674948.3090.40.camel-OO0OHOuVXW89n/EXqpbZ8ns8WZQLr0HW@public.gmane.org>
2012-09-24 22:19               ` Nicolas
     [not found]                 ` <5060DC56.4080609-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2013-02-26  1:50                   ` Nicolas
     [not found]                     ` <CACHCVZ6uvDW1CpyxXio3P17EL6bE=FKGDNm11RNZTceR-dWLjg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-02-26 10:56                       ` Mark Wielaard [this message]
     [not found]                         ` <1361876163.4930.4.camel-Et2QWsRS+g7yukXOleVwRPp4M6BF03vq@public.gmane.org>
2013-03-20 13:37                           ` Arnaldo Carvalho de Melo
2015-11-11 18:26 David Sterba
     [not found] ` <20151111182618.GF6445-AlSwsSmVLrQ@public.gmane.org>
2015-11-11 20:11   ` Arnaldo Carvalho de Melo
     [not found]     ` <20151111201151.GA6712-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2015-11-11 21:05       ` David Sterba
     [not found]         ` <20151111210519.GG6445-AlSwsSmVLrQ@public.gmane.org>
2015-11-11 22:13           ` Arnaldo Carvalho de Melo
     [not found]             ` <20151111221340.GB12579-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2015-11-11 22:17               ` Arnaldo Carvalho de Melo
     [not found]                 ` <20151111221747.GC12579-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2015-11-11 22:48                   ` Arnaldo Carvalho de Melo

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=1361876163.4930.4.camel@bordewijk.wildebeest.org \
    --to=mjw-h+wxahxf7alqt0dzr+alfa@public.gmane.org \
    --cc=dwarves-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=nikos42-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.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

Dwarves Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/dwarves/0 dwarves/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dwarves dwarves/ https://lore.kernel.org/dwarves \
		dwarves@vger.kernel.org
	public-inbox-index dwarves

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.dwarves


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git