Subject: | Parse::Readelf::Debug::Info::structure_layout() documentation does not match code |
Date: | Thu, 9 Dec 2010 15:46:25 +0000 |
To: | "bug-Parse-Readelf [...] rt.cpan.org" <bug-Parse-Readelf [...] rt.cpan.org> |
From: | Daniel Hulme <Daniel.Hulme [...] arm.com> |
Thanks for creating and sharing this library, which is helping me to read structure layout from a program and present it in a different form.
The documentation for structure_layout() describes the return value as an array where each element is "a quintuple containing (in that order) I<relative level>, I<name>, I<data type>, I<size> and I<offset>", and mentions two additional entries for bit-fields. The element is set up (on line 1067) as follows:
@result = ([$level, $name, $type_name, $size, $location,
$offset, @bit_data],
@sub_layout);
That is, each element is a sextuple, and the location (an arrayref containing TU number, file number, and line number) appears after the size and before the offset. This is a rather confusing mismatch. Since the module doesn't provide a way to find out which TU the TU number corresponds to, nor the name of the file the file number corresponds to, my preferred resolution would be to take $location out (i.e. make the code match the documented interface) rather than to change the documented interface to match the code.
-- IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.