This is the mail archive of the dwarf2@corp.sgi.com mailing list for the dwarf2 project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: REVISED PROPOSAL 000519.1 re Factored Offsets [joint with Keith]


>
>I am really confused.
>
>First you say that SGI compilers do *not* use factored offsets for
>DW_CFA_def_cfa_offset and DW_CFA_def_cfa:
>
>>>   - Some implementions treat all four instructions as using factored
>>>     offsets. Known examples are ARM's compiler for ARM, TI's compiler
>>>     for ARM, SGI's compiler(s) for MIPS, Aonix's ObjectAda compiler.
>>
>>       SGI's compilers for MIPS do *not* fit in the above category.
>>
>>>   - Some implementation treat only DW_CFA_offset and DW_CFA_offset_extended
>>>     as using factored offsets, which unfactored offsets are used for
>>>     DW_CFA_def_cfa and DW_CFA_def_cfa_offset. Know examples are gcc
>>>     and Compaq's compilers for Alpha.
>>>
>        SGI's compilers for MIPS fit in this second category with gcc.
>
>Then you say they do (indeed, could not work without doing so):
>
>>SGI/gcc are *using* the fact that the DW_CFA_def_cfa_offset and
>>DW_CFA_def_cfa is positive and the factor is negative.  Without
>>this the existing offsets and cfa setups on MIPS don't work
>>because sgi uses a positive DW_CFA_def_cfa_offset (from the sp
>>register value) and a negative (before factoring out a -4)
>>DW_CFA_offset (from the CFA value).

Me too (really confused).

Anyway, 

SGI and gcc use factored offset for
	DW_CFA_offset and DW_CFA_offset_extended

SGI and gcc use a non-factored offset for
	DW_CFA_def_cfa_offset and DW_CFA_def_cfa

Because the factor (-4) is negative, 
a) the CFA itself can be a register plus a positive offset
	(no factoring of offset, the offset recorded in
	dwarf as unsigned as that is what section 6.4.1
	calls for). 

b) A save/restore for a particular 
   	real register, such as the $ra register,
	can be  offset*factor + the implicit CFA 
        (where CFA can be, as I say in in (a),
        a a register plus a positive offset).
	The offset*factor results in a negative number
	as the factor is -4 (for MIPS/sgi)
        and the offset itself recorded in the dwarf section 
	is unsigned (because the -4 is factored out before
	writing to disk).


Hope the above is clearer. And hope I've not goofed it up 
somehow.

davea@sgi.com

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]