[Dwarf-Discuss] Location list entries for caller-saved registers at time of call

Cary Coutant ccoutant@gmail.com
Fri Dec 7 16:58:42 GMT 2018


> Speaking generally, a producer should describe the code generated and
> nothing more.  It should not attempt to anticipate or compensate for the
> behavior of a consumer.  That leads to bugs in the consumer causing
> bugs in the producer.  The reverse is true, naturally, but consumers
> often have to adapt to odd (or buggy) producers.

And that's another reason why on PA-RISC and Itanium we have the rule
that the unwind info for the PC of the instruction following the call
must be accurate. With that rule, we do not have to anticipate or
compensate for the consumer. One hack always begets another hack. (Of
course, if some debuggers were to subtract 1 despite that rule, we
would have to either compensate or declare them buggy.)

Jakub complains that "the compiler would need to emit a nop after
every call, which an optimizing compiler is not willing to do." We're
not talking about *every* call, just the rare case of a no-return
call.

-cary



More information about the Dwarf-discuss mailing list