From: Michael Haupt <michael.haupt@oracle.com>
To: "gdb@sourceware.org" <gdb@sourceware.org>
Subject: Re: debugging custom array types
Date: Wed, 13 Feb 2013 10:50:00 -0000 [thread overview]
Message-ID: <F0A8CF7E-F138-4644-895D-FB8D4FAB7DD5@oracle.com> (raw)
In-Reply-To: <20130211170221.GA16645@host2.jankratochvil.net>
Jan,
thanks a lot, this is most enlightening ...
Am 11.02.2013 um 18:02 schrieb Jan Kratochvil <jan.kratochvil@redhat.com>:
> On Mon, 11 Feb 2013 17:51:36 +0100, Michael Haupt wrote:
>> The internal layout of an array instance is as follows:
>> +0 hub reference (reference to meta-information, e.g., class, vtable, ...)
>> +8 length
>> +12 beginning of array contents (offset depends on type, 12 is for char, for instance)
>
> THis means the type length is stored in inferior memory. I call it 'dynamic
> type', FSF GDB does not support it, it is supported in
> archer-jankratochvil-vla from
> http://sourceware.org/gdb/wiki/ArcherBranchManagement
> or in any Fedora GDB.
Is there documentation somewhere that explicates which pieces of DWARF gdb supports out of the box? I'm not opposed to patching it but would like to know better what to (not) expect.
>> The DWARF I'm generating right now looks as pasted at the end of this message.
>
> Could you display it with GNU binutils "readelf -wi"? There aren't the DWARF
> expressions decoded so it is not easy to read what you have there.
Sure; sorry about having missed that. It's pasted below. Interestingly the byte_size DWARF expressions are not interpreted.
The one in char_array looks as follows:
DW_OP_push_object_address
DW_OP_plus_uconst: 8
DW_OP_deref_size: 4
DW_OP_const1u: 2
DW_OP_mul
DW_OP_plus_uconst: 12
The one in the array type, as follows:
DW_OP_push_object_address
DW_OP_plus_uconst: 8
DW_OP_deref_size: 4
DW_OP_const1u: 2
DW_OP_mul
Best,
Michael
<1><5320>: Abbrev Number: 16 (DW_TAG_structure_type)
<5321> DW_AT_name : (indirect string, offset: 0x177): char_array
<5325> DW_AT_byte_size : 10 byte block: 97 23 8 94 4 8 2 1e 23 c
<5330> DW_AT_sibling : <0x5359>
<2><5334>: Abbrev Number: 10 (DW_TAG_member)
<5335> DW_AT_name : (indirect string, offset: 0xdc): __hub_reference__
<5339> DW_AT_type : <0x5c6f>
<533d> DW_AT_data_member_location: 2 byte block: 23 0 (DW_OP_plus_uconst: 0)
<2><5340>: Abbrev Number: 10 (DW_TAG_member)
<5341> DW_AT_name : (indirect string, offset: 0x185): __length__
<5345> DW_AT_type : <0x2d>
<5349> DW_AT_data_member_location: 2 byte block: 23 8 (DW_OP_plus_uconst: 8)
<2><534c>: Abbrev Number: 10 (DW_TAG_member)
<534d> DW_AT_name : (indirect string, offset: 0x195): __array__
<5351> DW_AT_type : <0x5a6c>
<5355> DW_AT_data_member_location: 2 byte block: 23 c (DW_OP_plus_uconst: 12)
...
<1><5a6c>: Abbrev Number: 11 (DW_TAG_array_type)
<5a6d> DW_AT_type : <0x4f11>
<5a71> DW_AT_byte_size : 8 byte block: 97 23 8 94 4 8 2 1e
<5a7a> DW_AT_data_location: 3 byte block: 97 23 c (DW_OP_push_object_address; DW_OP_plus_uconst: 12)
<5a7e> DW_AT_sibling : <0x5a91>
<2><5a82>: Abbrev Number: 14 (DW_TAG_subrange_type)
<5a83> DW_AT_type : <0x2d>
<5a87> DW_AT_upper_bound : 8 byte block: 97 23 8 94 4 8 1 1c (DW_OP_push_object_address; DW_OP_plus_uconst: 8; DW_OP_deref_size: 4; DW_OP_const1u: 1; DW_OP_minus)
--
Dr. Michael Haupt
Principal Member of Technical Staff
Phone: +49 331 200 7277, Fax: +49 331 200 7561
Oracle Labs
Oracle Deutschland B.V. & Co. KG, Schiffbauergasse 14, 14467 Potsdam, Germany
next prev parent reply other threads:[~2013-02-13 10:50 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-11 16:51 Michael Haupt
2013-02-11 17:02 ` Jan Kratochvil
2013-02-13 10:50 ` Michael Haupt [this message]
2013-02-13 17:52 ` Tom Tromey
2013-02-14 13:27 ` Michael Haupt
2013-02-14 16:51 ` Tom Tromey
2013-02-13 17:59 ` Jan Kratochvil
2013-02-14 13:37 ` Michael Haupt
2013-02-14 13:44 ` Jan Kratochvil
2013-02-12 19:28 ` Tom Tromey
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=F0A8CF7E-F138-4644-895D-FB8D4FAB7DD5@oracle.com \
--to=michael.haupt@oracle.com \
--cc=gdb@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