This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: mn10300 assembler relaxation breaks dwarf2 debugging info
On Mon, May 14, 2001 at 05:08:46PM +0930, amodra@one.net.au wrote:
> 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).
Yikes, the situation is even worse. If md_assemble makes use of
frag_var for variable size insns, the current frag is finished and a
new one started. dwarf2_emit_insn will be fiddling with the wrong
frag.
> 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.
And the current frag too.
--
Alan