This is the mail archive of the
dwarf2@corp.sgi.com
mailing list for the dwarf2 project.
Re: REVISED PROPOSAL 000519.1 re Factored Offsets [joint with Keith]
- To: BRENDER at gemgrp dot zko dot dec dot com, DWARF2 at corp dot sgi dot com, brender at gemgrp dot zko dot dec dot com (Ron 603-884-2088)
- Subject: Re: REVISED PROPOSAL 000519.1 re Factored Offsets [joint with Keith]
- From: davea at quasar dot engr dot sgi dot com (David B Anderson)
- Date: Wed, 28 Jun 2000 08:54:51 -0700 (PDT)
- Reply-To: davea at quasar dot engr dot sgi dot com (David B Anderson)
>
>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