From: Daniel Jacobowitz <drow@false.org>
To: gdb-patches@sourceware.org
Subject: [rfc] gdb_stdint.h.
Date: Fri, 05 May 2006 17:27:00 -0000 [thread overview]
Message-ID: <20060505172713.GF31029@nevyn.them.org> (raw)
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 <dan@codesourcery.com>
* 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
next reply other threads:[~2006-05-05 17:27 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-05-05 17:27 Daniel Jacobowitz [this message]
2006-05-05 19:32 ` Jim Blandy
2006-05-05 21:50 ` Eli Zaretskii
2006-05-05 21:57 ` Michael Snyder
2006-05-15 17:16 ` Daniel Jacobowitz
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=20060505172713.GF31029@nevyn.them.org \
--to=drow@false.org \
--cc=gdb-patches@sourceware.org \
/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