mn10300 assembler relaxation breaks dwarf2 debugging info

amodra@one.net.au amodra@one.net.au
Mon May 14 00:34:00 GMT 2001


On Mon, May 14, 2001 at 02:21:13AM -0300, Alexandre Oliva wrote:
> The assembler manages to mess up the addresses of regions associated
> with source lines when doing relaxations.  The problem is that we
> anchor debugging info to the end of an insn minus its size.  However,
> when relaxation modifies the size of the insn, debugging info isn't
> adjusted.

Why should it need to be adjusted?  The start of the instruction
relative to the beginning of the frag surely doesn't change during
relaxation, and that's what the "end of an insn minus its size" is
calculating.  Isn't the problem really that the "size" param of
dwarf2_emit_insn is actually the maximum size of the insn?  (See
what frag_now_fix returns).

IMNSHO, passing the size of the insn to dwarf2_emit_insn is a bit
silly;  Why not pass the start of the insn instead?  It's easy to
save the current frag offset at the start of md_assemble.

-- 
Alan



More information about the Binutils mailing list