remote-sim.h

Mike Frysinger vapier@gentoo.org
Tue Nov 1 03:55:00 GMT 2011


On Monday 31 October 2011 14:11:08 Mike Stump wrote:
> So, gdb includes remote-sim.h, but CORE_ADDR_TYPE isn't defined by the time
> the header is included.  On my platform, CORE_ADDR_TYPE is defined in
> sim-main.h.  I checked and the BFD bits are defined, so, I just use them
> as a fallback, works for my purposes.  I don't think this is the cleanest
> solution, so I don't think this is the right patch for the tree.  So, I
> kinda want to include sim-basics.h before this point, as that file, the
> sim people decided, would ensure that CORE_ADDR_TYPE is defined.  So, we
> can include that file here?  The problem is, there is no -I for any of the
> sim things, and that header will want to include things like cconfig.h... 
> Ick.  I kinda want the api to just use a fixed type that is big enough for
> any of the bfd targets and be done with it.  Thoughts?
> 
> --- include/gdb/remote-sim.h    (revision 1866)
> +++ include/gdb/remote-sim.h    (working copy)
> @@ -32,8 +32,12 @@ extern "C" {
>     gdb does (unsigned int - from defs.h).  */
> 
>  #ifndef CORE_ADDR_TYPE
> +#if BFD_ARCH_SIZE <= 32
>  typedef unsigned int SIM_ADDR;
>  #else
> +typedef unsigned long SIM_ADDR;
> +#endif
> +#else
>  typedef CORE_ADDR_TYPE SIM_ADDR;
>  #endif

i'm guessing you're creating a 64bit simulator.  this setup won't work when 
building on a 32bit system as unsigned long will still be 32bit.  i wonder if 
bfd_vma would be appropriate as a default instead, but i'm not sure of the 
exact purpose of that type ...
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://sourceware.org/pipermail/gdb-patches/attachments/20111101/c992863d/attachment.sig>


More information about the Gdb-patches mailing list