From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8797 invoked by alias); 5 May 2006 17:27:21 -0000 Received: (qmail 8782 invoked by uid 22791); 5 May 2006 17:27:19 -0000 X-Spam-Check-By: sourceware.org Received: from nevyn.them.org (HELO nevyn.them.org) (66.93.172.17) by sourceware.org (qpsmtpd/0.31.1) with ESMTP; Fri, 05 May 2006 17:27:15 +0000 Received: from drow by nevyn.them.org with local (Exim 4.54) id 1Fc45B-0000Cm-3s for gdb-patches@sourceware.org; Fri, 05 May 2006 13:27:13 -0400 Date: Fri, 05 May 2006 17:27:00 -0000 From: Daniel Jacobowitz To: gdb-patches@sourceware.org Subject: [rfc] gdb_stdint.h. Message-ID: <20060505172713.GF31029@nevyn.them.org> Mail-Followup-To: gdb-patches@sourceware.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.8i X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2006-05/txt/msg00070.txt.bz2 You want uintptr_t? I got your uintptr_t right here. This patch creates a header in the build directory named gdb_stdint.h. It defines all of the things which a stdint.h ought to define. It uses the system's stdint.h if there is one, and provides anything missing, up to and including the whole file. There is, of course, a huge hairy chunk of m4 and portability knowledge that you don't see in this patch. That's because it's already in config/ and was written for GCC. I'm OK with that :-) It means it's quite well tested at this point. This would be enough to allow us to start using uint64_t, uintptr_t, et cetera in the common code of GDB. Which, in my opinion, would be a good idea. They're nice to have around. Any comments? -- Daniel Jacobowitz CodeSourcery 2006-05-05 Daniel Jacobowitz * configure.ac: Use GCC_HEADER_STDINT. * acinclude.m4: Include stdint.m4. * Makefile.in (gdb_stdint_h): Define. (distclean): Remove gdb_stdint.h. (Makefile, stamp-h): Update rules to generate only the correct files. (gdb_stdint.h, stamp-int): New rules. * config.in, configure: Regenerated. Index: configure.ac =================================================================== RCS file: /cvs/src/src/gdb/configure.ac,v retrieving revision 1.31 diff -u -p -r1.31 configure.ac --- configure.ac 29 Mar 2006 22:58:54 -0000 1.31 +++ configure.ac 5 May 2006 17:23:04 -0000 @@ -422,6 +422,9 @@ AC_CHECK_HEADERS(term.h, [], [], # unconditionally, so what's the point in checking these? AC_CHECK_HEADERS(ctype.h time.h) +# Create a header we can use portably to get the standard integer types. +GCC_HEADER_STDINT(gdb_stdint.h) + # ------------------------- # # Checks for declarations. # # ------------------------- # Index: acinclude.m4 =================================================================== RCS file: /cvs/src/src/gdb/acinclude.m4,v retrieving revision 1.13 diff -u -p -r1.13 acinclude.m4 --- acinclude.m4 17 Dec 2005 22:33:59 -0000 1.13 +++ acinclude.m4 5 May 2006 17:23:05 -0000 @@ -7,6 +7,9 @@ sinclude(../bfd/bfd.m4) dnl This gets the standard macros, like the TCL, TK, etc ones. sinclude(../config/acinclude.m4) +dnl This gets GCC_HEADER_STDINT. +sinclude(../config/stdint.m4) + sinclude(../gettext.m4) dnl The lines below arrange for aclocal not to bring gettext.m4's dnl CY_GNU_GETTEXT into aclocal.m4. Index: Makefile.in =================================================================== RCS file: /cvs/src/src/gdb/Makefile.in,v retrieving revision 1.811 diff -u -p -r1.811 Makefile.in --- Makefile.in 23 Apr 2006 14:15:01 -0000 1.811 +++ Makefile.in 5 May 2006 17:23:05 -0000 @@ -613,6 +613,7 @@ hashtab_h = $(INCLUDE_DIR)/hashtab.h config_h = config.h exc_request_U_h = exc_request_U.h exc_request_S_h = exc_request_S.h +gdb_stdint_h = gdb_stdint.h msg_reply_S_h = msg_reply_S.h msg_U_h = msg_U.h notify_S_h = notify_S.h @@ -1280,6 +1281,7 @@ distclean: clean rm -f gdbserver/tm.h gdbserver/xm.h gdbserver/nm.h rm -f gdbserver/Makefile gdbserver/config.cache rm -f nm.h tm.h xm.h config.status config.h stamp-h .gdbinit + rm -f gdb_stdint.h rm -f y.output yacc.acts yacc.tmp y.tab.h rm -f config.log config.cache rm -f Makefile @@ -1317,11 +1319,28 @@ subdir_do: force done Makefile: Makefile.in config.status @frags@ - $(SHELL) config.status + # Regenerate the Makefile and the tm.h / nm.h links. + CONFIG_FILES=Makefile \ + CONFIG_COMMANDS= \ + CONFIG_HEADERS= \ + $(SHELL) config.status config.h: stamp-h ; @true stamp-h: config.in config.status - CONFIG_HEADERS=config.h:config.in $(SHELL) config.status + CONFIG_HEADERS=config.h:config.in \ + CONFIG_COMMANDS=default \ + CONFIG_FILES= \ + CONFIG_LINKS= \ + $(SHELL) config.status + +gdb_stdint.h: stamp-int ; @true +stamp-int: config.status + CONFIG_COMMANDS=gdb_stdint.h \ + CONFIG_FILES= \ + CONFIG_HEADERS= \ + CONFIG_LINKS= \ + $(SHELL) config.status + echo stamp > stamp-int config.status: configure configure.tgt configure.host $(SHELL) config.status --recheck