Bug 447493 - Field not display in a ADA Structure
Summary: Field not display in a ADA Structure
Status: RESOLVED FIXED
Alias: None
Product: TCF
Classification: Tools
Component: Agent (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P3 major (vote)
Target Milestone: 1.3   Edit
Assignee: Project Inbox CLA
QA Contact: Eugene Tarassov CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-10-16 04:48 EDT by xavier pouyollon CLA
Modified: 2015-06-16 03:17 EDT (History)
0 users

See Also:


Attachments
Ada test program and logs from Workbench. (303.36 KB, application/x-gzip)
2014-10-16 04:48 EDT, xavier pouyollon CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description xavier pouyollon CLA 2014-10-16 04:48:00 EDT
Created attachment 247915 [details]
Ada test program and logs from Workbench.

Hi Eugene,

I'm trying to evaluate ADA support.
With the attached module, we put a breakpoint in p function (file p.adb, line 3)
When the breakpoint is hit, I step to line 
   Do_Nothing (V); -- BREAK

Then I want to display v structure.
It can not display the "size" field.

I'm trying to understand what's wrong here.
Not being 100% sure (I'm still trying to figure-out how expression evaluation work), I think the following command:
Symbols getContext "@S2.805.1208116.5416ED1C.857.0.0.-1.0.0.0.P2" <eom>
should return a "size" property in the reply (and probably lowerbound / upperbound).

 <3><857>: Abbrev Number: 5 (DW_TAG_member)
    <858>   DW_AT_name        : (indirect string, offset: 0xd3c): size
    <85c>   DW_AT_decl_file   : 1
    <85d>   DW_AT_decl_line   : 4
    <85e>   DW_AT_type        : <0x754>
    <862>   DW_AT_data_member_location: 0
My guess is that TCF is unable to properly infer the size from this DIE and continue the get the size from <765>:
 <1><754>: Abbrev Number: 2 (DW_TAG_subrange_type)
    <755>   DW_AT_lower_bound : 0x80000000
    <759>   DW_AT_upper_bound : 0x7fffffff
    <75d>   DW_AT_name        : (indirect string, offset: 0xe00): pack__index
    <761>   DW_AT_type        : <0x765>

 <1><765>: Abbrev Number: 3 (DW_TAG_base_type)
    <766>   DW_AT_byte_size   : 4
    <767>   DW_AT_encoding    : 5       (signed)
    <768>   DW_AT_name        : (indirect string, offset: 0xd0f): integer


I'm not sure how you can replicate the issue on your side.
On my side, vxWorks has the "Expression" service running in the target and the "Symbol" service service running in the value-add (host). Not easy to understand what goes wrong. 
If you have some debugging techniques to share with me, I would really appreciate. (Unfortunately, adding again Expression in config.h isn't enough to bring back Expression and Service services in the value-add)

Best Regards,
Xavier.
Comment 1 xavier pouyollon CLA 2014-10-17 12:16:21 EDT
Still trying to understand what goes wrong.

At some point, we are looking for AT_byte_size in die <754>
 <1><754>: Abbrev Number: 2 (DW_TAG_subrange_type)
    <755>   DW_AT_lower_bound : 0x80000000
    <759>   DW_AT_upper_bound : 0x7fffffff
    <75d>   DW_AT_name        : (indirect string, offset: 0xe00): pack__index
    <761>   DW_AT_type        : <0x765>
 <1><765>: Abbrev Number: 3 (DW_TAG_base_type)
    <766>   DW_AT_byte_size   : 4
    <767>   DW_AT_encoding    : 5       (signed)
    <768>   DW_AT_name        : (indirect string, offset: 0xd0f): integer

it doesn't find it in the die but it does not continue the search in <765>.
Still trying to understand why: I probably need to call get_dwarf_children in get_object_size to handle such case.

Any "big pictures", advices where to look at are welcome. 

Best Regards,
Xavier.
Comment 2 Eugene Tarassov CLA 2014-10-17 17:12:27 EDT
Yes, when TAG_subrange_type does not have size attribute, debugger should check size if the base type.

Fixed.
Thanks!
Comment 3 xavier pouyollon CLA 2014-10-21 04:52:53 EDT
Hi Eugene,

I've tried your fix and it displays the field !
Many Thanks ! 

For my understanding : Do you use a vxWorks installation to test again the .out file I supplied or do you only use dwarf-test to improve the dwarf-reader ?
I'd really happy to know more about your debug workflow / techniques on these issues.

Best Regards,
Xavier.
Comment 4 Eugene Tarassov CLA 2014-10-21 11:54:05 EDT
(In reply to xavier pouyollon from comment #3)
> Hi Eugene,

> For my understanding : Do you use a vxWorks installation to test again the
> .out file I supplied or do you only use dwarf-test to improve the
> dwarf-reader ?

I use dwarf-test. I don't have access to vxWorks.