This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: [MIPS sim patch] sim_monitor cleanup


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]