From: Vladimir Prus <vladimir@codesourcery.com>
To: gdb-patches@sources.redhat.com
Subject: Support constants for DW_AT_data_member_location
Date: Thu, 29 Nov 2007 09:54:00 -0000 [thread overview]
Message-ID: <200711291254.14423.vladimir@codesourcery.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 237 bytes --]
DWARF standard allows DW_AT_data_member_location value
to be a plain constant, but GDB does not. Is the following OK?
- Volodya
* dwarf2read.c (dwarf2_add_field): Allow
the DW_AT_data_member_location to be of
DW_FORM_udata form.
[-- Attachment #2: constant_data_member_location.diff --]
[-- Type: text/x-diff, Size: 517 bytes --]
--- dwarf2read.c (revision 123)
+++ dwarf2read.c (local)
@@ -3500,8 +3500,11 @@ dwarf2_add_field (struct field_info *fip
attr = dwarf2_attr (die, DW_AT_data_member_location, cu);
if (attr)
{
- FIELD_BITPOS (*fp) =
- decode_locdesc (DW_BLOCK (attr), cu) * bits_per_byte;
+ if (attr->form == DW_FORM_udata)
+ FIELD_BITPOS (*fp) = 8 * DW_UNSND (attr);
+ else
+ FIELD_BITPOS (*fp) =
+ decode_locdesc (DW_BLOCK (attr), cu) * bits_per_byte;
}
else
FIELD_BITPOS (*fp) = 0;
next reply other threads:[~2007-11-29 9:54 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-29 9:54 Vladimir Prus [this message]
2007-11-29 19:39 ` Jim Blandy
2007-11-29 20:18 ` Vladimir Prus
2007-12-01 1:48 ` Jim Blandy
2007-12-13 17:57 ` Vladimir Prus
2007-12-13 19:29 ` Jim Blandy
2007-12-17 19:30 ` Jim Blandy
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=200711291254.14423.vladimir@codesourcery.com \
--to=vladimir@codesourcery.com \
--cc=gdb-patches@sources.redhat.com \
/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