makedumpfile -g with recent kernels
stefan.bader at canonical.com
Mon Aug 6 03:39:53 EDT 2012
On 06.08.2012 07:54, Atsushi Kumagai wrote:
> Hello Stefan,
> On Thu, 02 Aug 2012 10:23:13 +0200
> Stefan Bader <stefan.bader at canonical.com> wrote:
>>> static void
>>> adjust_member_offset(Dwarf_Die *die)
>>> long offset;
>>> if (dwarf_info.member_offset == NOT_FOUND_STRUCTURE) // this comparison is always true
>>> if (!get_data_member_location(die, &offset))
>>> dwarf_info.member_offset += offset;
>>> At least, the change below works fine without regression.
>>> diff --git a/dwarf_info.c b/dwarf_info.c
>>> index 583df53..03e4c90 100644
>>> --- a/dwarf_info.c
>>> +++ b/dwarf_info.c
>>> @@ -520,7 +520,9 @@ search_member(Dwarf_Die *die)
>>> * Get the member offset.
>>> - if (!get_data_member_location(walker, &offset))
>>> + if (dwarf_tag(die) == DW_TAG_union_type)
>> Hm, should that not be die_type to check what the walker is on? And in that case
>> it seems that check was made just before... So maybe it would be ok to assume 0
>> as the offset when getting here...?
> As you said, the walker will be a member of union or struct when reaching here,
> because is_anonymous_container() already checked the walker.
> However, get_data_member_location() must succeed if the walker is a member of struct
> while it doesn't succeed if the walker is a member of union.
> That's why I added the code to check whether the walker is a member of union or not.
Right, I was just wondering whether that would allow to simplify even more. Like
if (!get_die_type(walker, &die_type))
if (dwarf_tag(&die_type) != DW_TAG_union_type)
* At this point it is clear that this is a union.
* Though unions have no offset elements (the offset
* is always 0. So get_data_member_location would fail.
dwarf_info.member_offset = 0;
> Atsushi Kumagai
>>> + offset = 0;
>>> + else if (!get_data_member_location(walker, &offset))
>>> dwarf_info.member_offset = offset;
>>> return TRUE;
>>> Unless you have better way to fix this issue, I'll merge your patch into
>>> the next version with the change above.
>>> By the way, this fix enable us also to get the offset of page._mapcount and
>>> page.private, it's very helpful for the new method of free page filtering.
>>> Atsushi Kumagai
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 900 bytes
Desc: OpenPGP digital signature
More information about the kexec