From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cagney To: Ben Elliston Cc: cagney@redhat.com, cgd@broadcom.com, gdb-patches@sources.redhat.com Subject: Re: [MIPS sim patch] sim_monitor cleanup Date: Mon, 19 Feb 2001 11:12:00 -0000 Message-id: <3A916F98.FB189897@cygnus.com> References: <14992.37492.971949.281244@scooby.cygnus.com> X-SW-Source: 2001-02/msg00367.html Ben Elliston wrote: > > The following patch gives `sim_monitor' a return type of `int' and > returns meaningful result codes that the caller can use to decide on > appropriate error handling. Almost. I'm fine with the theory just not the implementation. Reading: ! int reason = (instruction >> RSVD_INSTRUCTION_ARG_SHIFT) & RSVD_INSTRUCTION_ARG_MASK; ! if (sim_monitor (SD, CPU, cia, reason)) ! sim_io_error (sd, "TODO sim_monitor: reason = %d, pc = 0x%s\n", reason, pr_addr (cia)); just looks wierd. Could sim_monitor() return zero or negative to indicate fail (both are more common conventions) and perhaphs change ``TODO'' to something more meanginful :-) Andrew