This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [patch] m68k-dis.c: Don't get stuck in a strange state.
- From: Daniel Jacobowitz <drow at false dot org>
- To: Kazu Hirata <kazu at codesourcery dot com>
- Cc: binutils at sources dot redhat dot com
- Date: Mon, 9 Apr 2007 11:40:51 -0400
- Subject: Re: [patch] m68k-dis.c: Don't get stuck in a strange state.
- References: <200704050021.l350Ld7A010397@sparrowhawk.codesourcery.com>
On Wed, Apr 04, 2007 at 05:21:39PM -0700, Kazu Hirata wrote:
> The patch fixes the problem by restoring insn->fprintf_func and
> insn->print_address_func in print_insn_m68k when longjmp is used.
>
> Now, I admit that this solution is a bit dirty. Specifically, this
> patch exposes the fact that match_insn_m68k temporarily replaces
> insn->fprintf_func and insn->print_address_func.
>
> Perhaps, a real fix is to report a FETCH_DATA failure with a return
> value of some sort, without using setjmp/longjmp. A better fix may be
> to teach the m68k disassembler do its job without temporarily
> replacing insn->fprintf_func and insn->print_address_func, but that
> sounds like too big a surgery.
>
> OK to apply?
>
> Kazu Hirata
>
> opcodes/
> 2007-04-04 Kazu Hirata <kazu@codesourcery.com>
>
> * m68k-dis.c (print_insn_m68k): Restore info->fprintf_func and
> info->print_address_func if longjmp is called.
I agree with your reasoning; this is OK to apply.
--
Daniel Jacobowitz
CodeSourcery