This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [patch] sim/erc32/ max simulation time extended by using 64bit ints
- From: Doug Evans <dje at google dot com>
- To: Joel Brobecker <brobecker at adacore dot com>
- Cc: Joel Sherrill <joel dot sherrill at oarcorp dot com>, Tiemen Schut <T dot Schut at sron dot nl>, "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>
- Date: Mon, 17 May 2010 09:09:41 -0700
- Subject: Re: [patch] sim/erc32/ max simulation time extended by using 64bit ints
- References: <4BD1BBE3020000520000FC62@pluto.sron.nl> <m2ze394668d1004231328h55952dfpdea88e2fd17b4c2d@mail.gmail.com> <4BE08E95.5040500@oarcorp.com> <20100517015752.GA24402@adacore.com>
On Sun, May 16, 2010 at 6:57 PM, Joel Brobecker <brobecker@adacore.com> wrote:
> Hey guys,
>
>> Index: sim/erc32/sis.h
>> ===================================================================
>> RCS file: /cvs/src/src/sim/erc32/sis.h,v
>> retrieving revision 1.2
>> diff -u -r1.2 sis.h
>> --- sim/erc32/sis.h ? 9 Jun 2002 15:45:46 -0000 ? ? ? 1.2
>> +++ sim/erc32/sis.h ? 4 May 2010 21:14:55 -0000
>> @@ -23,6 +23,7 @@
>> ?#include "ansidecl.h"
>> ?#include "gdb/callback.h"
>> ?#include "gdb/remote-sim.h"
>> +#include <stdint.h>
>
> Unfortunately, this change breaks the build when stdint.h is not
> available (Eg. sparc-solaris).
How old is this solaris?
OTOH, gdb/defs.h unconditionally includes stdint.h (I think I checked
it at the time, so I approved the patch) so I'm confused.
> Apparently, this header was included for 2 things:
> ?- define two 64bit types int64 and uint64;
> ?- have UINT64_MAX.
>
> I assume that the requirement was for 64bit minimum, as opposed to
> exactly 64bit? Making that assumption, we can remove the need for
> including stdint.h by using long long instead of int64_t (same thing
> for the unsigned counterpart). ?Similarly, UINT64_MAX has a well defined
> value reguardless of the platform, so it can easily be defined as well.
> Looking at the rest of the type definitions above, it's actually in line
> with what's been done so far.
>
> Joel: Would that work for you as well?
>
> Doug: Would that be OK to commit? I think that the cleanest thing to do
> ? ? ?here would be to have some configury that would provide our own
> ? ? ?stdint.h when missing. ?We already do that for GDB by using gnulib
> ? ? ?so perhaps one way to do so would be to share the gnulib between
> ? ? ?GDB and the sim (probably meaning moving it to the root directory).
For reference sake, there's bfd_stdint.h generated by
config/stdint.m4. I don't know all that it handles, but again gdb
itself just includes stdint.h unconditionally.
> PS: We have the same problem with rx sim, I believe. I haven't tried
> ? ?building it, though.