From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cagney To: Will Cohen Cc: gdb-patches@sources.redhat.com Subject: Re: Patch to provide m68k simulator to gdb Date: Thu, 01 Mar 2001 11:54:00 -0000 Message-id: <3A9EA833.9EDC4407@cygnus.com> References: <3A9C3128.A52307A@redhat.com> <3A9D2941.ECA95C7E@cygnus.com> <3A9EA1B9.471A7BE9@redhat.com> X-SW-Source: 2001-03/msg00022.html Will Cohen wrote: > > There are a number of changes between the old interfaces used by m68k > (and sh) and the newer simulators. Using nrun.c requires a number of > other things to be modified. Is there there some documentation that > describes the various defines and functions required by this newer > interface? Or is the situation "The code IS the documentation"? If > "The code IS the documentation," which simulator is the best one to > model the changes after? > > I would like to remove these hard-coded numbers in the > sim_fetch_registers and sim_store_register functions. Where should > REGISTER_SIM_REGNO be defined. I couldn't find an example of its > definition in the version of gdb I am using. Unfortunatly, ``the code IS the documentation''. The mn10300 may be best although others probably have better suggestions. REGISTER_SIM_REGNO would be defined as part of gdb/config/m68k/tm-m68k.h and friends. It would map onto a function. To decide if you need REGISTER_SIM_REGNO, check the gdb/config/m68k/tm-*.h to see if there is more than one defintion of REGISTER_BYTE and/or register numbering. Hmm, looks like it only appears in tm-m68k.h (correct?). I would lay out include/sim-m68k.h to match the register numbering implied by tm-m68k.h:REGISTER_BYTE(REGNUM). If an m68k target ever re-orders its registers then that target can implement REGISTER_SIM_REGNO to map that numbering onto the standard. Hopefully no one will do that but if they do the sim side is ready. Andrew