Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Joel Brobecker <brobecker@adacore.com>
To: Joel Sherrill <joel.sherrill@oarcorp.com>
Cc: Doug Evans <dje@google.com>, Tiemen Schut <T.Schut@sron.nl>,
	"gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: Re: [patch] sim/erc32/ max simulation time extended by using 64bit 	ints
Date: Mon, 17 May 2010 02:08:00 -0000	[thread overview]
Message-ID: <20100517015752.GA24402@adacore.com> (raw)
In-Reply-To: <4BE08E95.5040500@oarcorp.com>

[-- Attachment #1: Type: text/plain, Size: 1597 bytes --]

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).

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).

PS: We have the same problem with rx sim, I believe. I haven't tried
    building it, though.

-- 
Joel

[-- Attachment #2: erc32-sim.diff --]
[-- Type: text/x-diff, Size: 1115 bytes --]

Fix erc32 sim build failure due to missing stdint.h.

2010-05-16  Joel Brobecker  <brobecker@adacore.com>

        * sis.h: Remove #include <stdint.h>.
        (uint64, int64): Redefine without using stdint.h.
        (UINT64_MAX): Define.

Modified: trunk/gdb/gdb-head/sim/erc32/sis.h
===================================================================
--- trunk/gdb/gdb-head/sim/erc32/sis.h	2010-05-17 01:21:31 UTC (rev 163986)
+++ trunk/gdb/gdb-head/sim/erc32/sis.h	2010-05-17 01:41:06 UTC (rev 163987)
@@ -23,7 +23,6 @@
 #include "ansidecl.h"
 #include "gdb/callback.h"
 #include "gdb/remote-sim.h"
-#include <stdint.h>
 
 #include "end.h"
 
@@ -53,9 +52,11 @@
 typedef double  float64;	/* 64-bit float */
 
 /* FIXME: what about host compilers that don't support 64-bit ints? */
-typedef uint64_t uint64; /* 64-bit unsigned int */
-typedef int64_t int64;	/* 64-bit signed int */
+typedef unsigned long long uint64; /* 64-bit unsigned int */
+typedef long long int64;	   /* 64-bit signed int */
 
+#define UINT64_MAX 18446744073709551615ULL
+
 struct pstate {
 
     float64         fd[16];	/* FPU registers */

  parent reply	other threads:[~2010-05-17  1:58 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-23 13:25 Tiemen Schut
2010-04-23 20:28 ` Doug Evans
2010-05-04 21:16   ` Joel Sherrill
2010-05-07 17:48     ` Doug Evans
2010-05-17  2:08     ` Joel Brobecker [this message]
2010-05-17  3:23       ` Joel Sherrill
2010-05-17 16:37       ` Doug Evans
2010-05-17 16:59         ` Joel Brobecker
2010-05-20 23:13       ` Joel Brobecker
2010-05-21 13:47         ` Joel Sherrill
2010-05-21 15:06           ` Joel Brobecker
2010-05-21 15:15             ` Joel Sherrill
2010-05-21 17:13               ` Doug Evans

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100517015752.GA24402@adacore.com \
    --to=brobecker@adacore.com \
    --cc=T.Schut@sron.nl \
    --cc=dje@google.com \
    --cc=gdb-patches@sourceware.org \
    --cc=joel.sherrill@oarcorp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox